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

Fix/xss #6403

Merged
merged 4 commits into from
Sep 27, 2024
Merged

Fix/xss #6403

merged 4 commits into from
Sep 27, 2024

Conversation

HuFlungDu
Copy link
Contributor

Did some fixes for possible XSS injections.

First: A filename could be constructed such that, when a user edits the file, it will execute a script. This was caused by the default page not doing HTML escape on some filenames.

Second: Fixed an injection possibility regarding query params. One could construct a URL like:

https://localhost/meshagents?key="><script>alert(1)</script><a+
Or, in tricky mode:
Click here to pwn yourself

I added EncodeURIComponent for most uses of req.query in webserver.js, but I can't guarantee I got them all.

@Ylianst
Copy link
Owner

Ylianst commented Sep 27, 2024

I just looked at your PR and yes! This is essential. I am releasing a new version right away. Thank you soooo much!!!

@Ylianst Ylianst merged commit 04c96eb into Ylianst:master Sep 27, 2024
3 checks passed
@Ylianst
Copy link
Owner

Ylianst commented Sep 27, 2024

I see function cleanReqQuery(req, res) {} in the PR, I will check. If not needed I will remove.

@HuFlungDu
Copy link
Contributor Author

Oh oops, you're right. I had originally intended on adding an express.use function to clean req.query, but I changed the implementation. Thought I had removed that. It definitely does not need to be there.

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.

2 participants