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

SECURITY.md explained #768

Closed
ertygiq opened this issue Jul 31, 2024 · 1 comment
Closed

SECURITY.md explained #768

ertygiq opened this issue Jul 31, 2024 · 1 comment

Comments

@ertygiq
Copy link

ertygiq commented Jul 31, 2024

In the SECURITY.md file it's mentioned that the following code is insecure:

app.get('/', (req, res) => {
    res.render('index', req.query);
});

Could you explain why?

@ertygiq ertygiq changed the title SECURITY.md exalained SECURITY.md explained Jul 31, 2024
@mde
Copy link
Owner

mde commented Aug 1, 2024

Because you are not checking what inputs are going into the render method. You are blindly passing end-user inputs into EJS, which means (depending on what's in your template) they could run arbitrary (and potentially malicious) JavaScript code on your server. It's a very similar security problem as SQL injection.

@mde mde closed this as completed Aug 1, 2024
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

2 participants