We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Step to reproduce :
Then open your browser and reach the following URL : http://localhost:1948/a.md/..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fetc.md%2F..%2Fetc%2Fpasswd#/
The content of the file /etc/passwd is disclosed.
I have a patch for it on the file lib/render.js :
function sanitize(entry) { if(entry.includes("..")) { entry = sanitize(entry.replace("..","")) } return entry } module.exports = async (req, res) => { const dir = await getInitialDir(); console.log(sanitize(decodeURIComponent(req.url))) const filePath = path.join(dir, sanitize(decodeURIComponent(req.url)).replace(/\?.*/, '')); const markup = await renderFile(filePath); res.send(markup); };
The text was updated successfully, but these errors were encountered:
Thanks @W0rty, please open a PR if you have a patch
Sorry, something went wrong.
No branches or pull requests
Step to reproduce :
Then open your browser and reach the following URL :
http://localhost:1948/a.md/..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fetc.md%2F..%2Fetc%2Fpasswd#/
The content of the file /etc/passwd is disclosed.
I have a patch for it on the file lib/render.js :
The text was updated successfully, but these errors were encountered: