Skip to content

SQL_Injection @ /Controllers/ProductsController.cs #38

@msant262

Description

@msant262

Checkmarx (SAST): SQL_Injection
Security Issue: Read More about SQL_Injection
Checkmarx Project: Nova-8/Damm-Vulnerable-CSharp-API
Repository URL: https://github.com/Nova-8/Damm-Vulnerable-CSharp-API
Branch: master
Scan ID: 2f22541b-da6c-459f-9285-99da61e0ed7d


The application's Search method executes an SQL query with query, at line 73 of /Controllers/ProductsController.cs. The application constructs this SQL query by embedding an untrusted string into the query without proper sanitization. The concatenated string is submitted to the database, where it is parsed and executed accordingly.

An attacker would be able to inject arbitrary syntax and data into the SQL query, by crafting a malicious payload and providing it via the input keyword; this input is then read by the Search method at line 65 of /Controllers/ProductsController.cs. This input then flows through the code, into a query and to the database server - without sanitization.

This may enable an SQL Injection attack.

Result 1:
Severity: HIGH
State: TO_VERIFY
Status: RECURRENT
Attack Vector:

    1. keyword: /Controllers/ProductsController.cs[65,42]
    2. keyword: /Controllers/ProductsController.cs[71,100]
    3. query: /Controllers/ProductsController.cs[71,14]
    4. query: /Controllers/ProductsController.cs[73,22]
    Review result in Checkmarx One: SQL_Injection

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions