Headline
CVE-2023-43656: Replace vm2 with quickjs (#817) · matrix-org/matrix-hookshot@dc126af
matrix-hookshot is a Matrix bot for connecting to external services like GitHub, GitLab, JIRA, and more. Instances that have enabled transformation functions (those that have generic.allowJsTransformationFunctions
in their config), may be vulnerable to an attack where it is possible to break out of the vm2
sandbox and as a result Hookshot will be vulnerable to this. This problem is only likely to affect users who have allowed untrusted users to apply their own transformation functions. If you have only enabled a limited set of trusted users, this threat is reduced (though not eliminated). Version 4.5.0 and above of hookshot include a new sandbox library which should better protect users. Users are advised to upgrade. Users unable to upgrade should disable generic.allowJsTransformationFunctions
in the config.
Commit
Permalink
Browse files
Browse the repository at this point in the history
Replace vm2 with quickjs (#817)
* quickjs test
* Replace vm2 with quickjs
* initalise -> initialise
* Remove unused transformation timeout time
* Don’t assume quickModule is set
Also use whether it’s set as the indicator of whether transformation functions are allowed, instead of checking the config
* Refactor GenericHookConnectionState validation
- Do it in the constructor instead of in callers
- Make hookId mandatory so as to not drop it on some state updates
- Conflate a state event’s state key with a connection state’s name, which was already the case in practice
* Refactor validateState
* Drop explicit any
Better to infer the type instead
* Always validate transformation fn
* Fix test
* Add changelog
* Fix disposal, validation, and printing
* Fix transformation error string formatting
Also refactor similar code
* Let invalid transformations run & fail
instead of pretending that one was never set
* Restore transformation timeout time
* Don’t execute transformation fn when validating it
Instead, only compile it
* Revert unrelated changes
Co-authored-by: Andrew Ferrazzutti [email protected]
- Loading branch information