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

SQL_Injection @ /CardTypesRecord.cs #25

Open
apcxtest opened this issue Oct 24, 2023 · 0 comments
Open

SQL_Injection @ /CardTypesRecord.cs #25

apcxtest opened this issue Oct 24, 2023 · 0 comments

Comments

@apcxtest
Copy link
Contributor

apcxtest commented Oct 24, 2023

Checkmarx (SAST): SQL_Injection
Security Issue: Read More about SQL_Injection
Applications: ilidioc_App, Microsserviços Produtivos, test_App
Checkmarx Project: apcxtestorg/testrepo
Repository URL: https://github.com/apcxtestorg/testrepo
Branch: main
Scan ID: a078e21a-b6dc-4705-a0cf-3262f0044fe1


The application's CardTypes_Show method executes an SQL query with Fill, at line 174 of /CardTypesRecord.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 Value; this input is then read by the CardTypes_Show method at line 165 of /CardTypesRecord.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. Value: /CardTypesRecord.cs[165,72]
    2. ToSQL: /CardTypesRecord.cs[165,41]
    3. sWhere: /CardTypesRecord.cs[165,3]
    4. sWhere: /CardTypesRecord.cs[169,53]
    5. sSQL: /CardTypesRecord.cs[169,10]
    6. sSQL: /CardTypesRecord.cs[170,53]
    7. OleDbDataAdapter: /CardTypesRecord.cs[170,32]
    8. dsCommand: /CardTypesRecord.cs[170,20]
    9. dsCommand: /CardTypesRecord.cs[174,7]
    10. Fill: /CardTypesRecord.cs[174,17]
    Review result in Checkmarx One: SQL_Injection

Result #2:
Severity: HIGH
State: TO_VERIFY
Status: RECURRENT
Attack Vector:

    1. Value: /CardTypesRecord.cs[271,91]
    2. ToSQL: /CardTypesRecord.cs[271,60]
    3. sWhere: /CardTypesRecord.cs[271,14]
    4. sWhere: /CardTypesRecord.cs[283,36]
    5. sSQL: /CardTypesRecord.cs[283,10]
    6. sSQL: /CardTypesRecord.cs[288,39]
    7. OleDbCommand: /CardTypesRecord.cs[288,22]
    8. cmd: /CardTypesRecord.cs[288,16]
    9. cmd: /CardTypesRecord.cs[290,5]
    10. ExecuteNonQuery: /CardTypesRecord.cs[290,9]
    Review result in Checkmarx One: SQL_Injection

Result #3:
Severity: HIGH
State: TO_VERIFY
Status: RECURRENT
Attack Vector:

    1. Value: /CardTypesRecord.cs[310,72]
    2. ToSQL: /CardTypesRecord.cs[310,41]
    3. sWhere: /CardTypesRecord.cs[310,3]
    4. sWhere: /CardTypesRecord.cs[313,50]
    5. sSQL: /CardTypesRecord.cs[313,9]
    6. sSQL: /CardTypesRecord.cs[318,38]
    7. OleDbCommand: /CardTypesRecord.cs[318,21]
    8. cmd: /CardTypesRecord.cs[318,15]
    9. cmd: /CardTypesRecord.cs[320,3]
    10. ExecuteNonQuery: /CardTypesRecord.cs[320,7]
    Review result in Checkmarx One: SQL_Injection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant