MrOtherGuy / fx-autoconfig

Load custom javascript in browser context
Mozilla Public License 2.0
178 stars 11 forks source link

stopping malicious external program from accessing boot.sys.mjs #57

Closed KAGEYAM4 closed 1 week ago

KAGEYAM4 commented 1 week ago

Would this be possible by using these 2 solutions?

  1. Put all the data of fx-autoconfig in programs folder which can only be accessed by root. Downside --> fx-autoconfig will be available to all the firefox profiles. Meaning all the users across all profiles.
  2. Per user firefox-flatpaks. This way fx-autoconfig will only be available to all profiles of one user-flatpak.
MrOtherGuy commented 1 week ago

#1 is out of the question. In my opinion it's critical that it is profile specific. That method should technically work though.

#2 is unsuitable for vast majority of people. Also, I don't think that autocofig feature works with flatpak currently anyway.

I think that the currently easiest solution is to set file permissions to read-only, but this is something the user must do manually for each profile.

KAGEYAM4 commented 1 week ago

Yes, read-only would be good idea with the owner being root.

So among below which files needs to be made read-only -->

├── profile
│   └── chrome
│       ├── CSS
│       │   ├── agent_style.uc.css
│       │   └── author_style.uc.css
│       ├── JS
│       │   ├── test.uc.js
│       │   ├── userChrome_ag_css.sys.mjs
│       │   └── userChrome_au_css.uc.js
│       ├── resources
│       │   ├── userChrome.ag.css
│       │   └── userChrome.au.css
│       └── utils
│           ├── boot.sys.mjs
│           ├── chrome.manifest
│           ├── fs.sys.mjs
│           ├── uc_api.sys.mjs
│           └── utils.sys.mjs
MrOtherGuy commented 1 week ago

That sort of depends on what you want. The loader itself is everything inside utils, so I imagine at least that directory should be read-only. All the other things are just example files.

If you care about something messing with you custom scripts then you should include the whole JS directory as well, because the loader looks for script files inside it. Obviously doing that could get rather annoying since you cannot then modify your own scripts without root.

KAGEYAM4 commented 1 week ago

Thank you.