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

Create another-sqli.js #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Create another-sqli.js #66

wants to merge 2 commits into from

Conversation

saargon
Copy link
Contributor

@saargon saargon commented Jul 10, 2023

No description provided.

return (req: Request, res: Response, next: NextFunction) => {
let criteria: any = req.query.q === 'undefined' ? '' : req.query.q ?? ''
criteria = (criteria.length <= 200) ? criteria : criteria.substring(0, 200)
models.sequelize.query("SELECT * FROM Products WHERE ((name LIKE '%"+criteria+"%' OR description LIKE '%"+criteria+"%') AND deletedAt IS NULL) ORDER BY name")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Aqua detected potential vulnerability in your code

Check name: express sequelize injection
CWE: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Severity: HIGH
Category: security/vuln
Technology: express
Description: Detected a sequelize statement that is tainted by user-input. This could lead to SQL injection if the variable is user-controlled and is not properly sanitized. In order to prevent SQL injection, it is recommended to use parameterized queries or prepared statements.
Source: A01:2017 - Injection
Confidence: HIGH
Likelihood: HIGH
Impact: HIGH
[This comment was created by Aqua Pipeline]

@saargon
Copy link
Contributor Author

saargon commented Oct 22, 2023

/skip-scan

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.

1 participant