Skip to content

fix(HeavyButter): add MJS require() module whitelist and permission system (AV-004)#2521

Open
r13xr13 wants to merge 1 commit into
BruceDevices:mainfrom
r13xr13:fix/mjs-whitelist-heavybutter
Open

fix(HeavyButter): add MJS require() module whitelist and permission system (AV-004)#2521
r13xr13 wants to merge 1 commit into
BruceDevices:mainfrom
r13xr13:fix/mjs-whitelist-heavybutter

Conversation

@r13xr13

@r13xr13 r13xr13 commented Jun 8, 2026

Copy link
Copy Markdown

Closes MJS sandbox escape.

…ystem (AV-004)

- Add SAFE_MODULES and DANGEROUS_MODULES lists to globals_js.cpp
- native_require() now checks whitelist: safe modules always allowed,
  dangerous modules require __allow() permission
- Add native_requireAllow() as __allow() JS global function
- Build hidden __module_registry in interpreter.cpp, remove dangerous
  modules from global scope
- Update 12 shipped JS scripts to add __allow() calls before using
  dangerous modules (storage, wifi, subghz, ir, serial, audio, gpio, badusb)

This closes the MJS sandbox escape vulnerability. Downloaded App Store
scripts that call require('storage') or require('wifi') without first
calling __allow() will receive a TypeError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant