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

[Question]: This following code below is vulnerable or not ? #980

Closed
diyarsaadi opened this issue Feb 27, 2024 · 1 comment
Closed

[Question]: This following code below is vulnerable or not ? #980

diyarsaadi opened this issue Feb 27, 2024 · 1 comment
Assignees
Labels
n/a Not Applicable

Comments

@diyarsaadi
Copy link

Vulnerable Line :
SQL Injection has been found. Change this code to no longer construct SQL queries directly from user-controlled data.

Calling method \iaDb,1::getAll(["var"]) in (216)\iaDb,1::_get(["row","MAX(order)","var","var","1"]) that outputs using tainted argument #1 ($sql).

Infected Line : 242

238
$sql = 'SELECT ' . $stmtFields . ' FROM ' . $this->_table . ' ' . $condition;
239

240
switch ($type) {
241
case 'all':
242
1return $this->getAll($sql);
243
case 'keyval':
244
return $this->getKeyValue($sql);
245
case 'assoc':
246
return $this->getAssoc($sql, true);
247
default:

#Description #

This code is vulnerable to SQL injection because the application receives data from the user or a third-party service and inserts it into a database query without sanitizing it first. It's a critical vulnerability.

@diyarsaadi diyarsaadi added the proposal Status: Proposal label Feb 27, 2024
@g0tmi1k
Copy link
Collaborator

g0tmi1k commented Jun 11, 2024

Hello @diyarsaadi

This question is off topic for this repo. This is for a collection of lists rather than getting help for code review

@g0tmi1k g0tmi1k closed this as completed Jun 11, 2024
@g0tmi1k g0tmi1k self-assigned this Jun 11, 2024
@g0tmi1k g0tmi1k added n/a Not Applicable and removed proposal Status: Proposal labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n/a Not Applicable
Projects
None yet
Development

No branches or pull requests

2 participants