Skip to content

Commit

Permalink
Merge remote-tracking branch 'GHSA-gf46-prm4-56pc/fix-advisory-3' int…
Browse files Browse the repository at this point in the history
…o release/8.0.5
  • Loading branch information
mflasquin committed Jul 19, 2023
2 parents 0691d08 + 79f352c commit f82cb30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions classes/RequestSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class RequestSqlCore extends ObjectModel
'RESET', 'START', 'STOP', 'PURGE', 'EXECUTE', 'PREPARE', 'DEALLOCATE', 'LOCK', 'USING', 'DROP', 'FOR', 'UPDATE', 'BEGIN', 'BY', 'ALL', 'SHARE',
'MODE', 'TO', 'KEY', 'DISTINCTROW', 'DISTINCT', 'HIGH_PRIORITY', 'LOW_PRIORITY', 'DELAYED', 'IGNORE', 'FORCE', 'STRAIGHT_JOIN',
'SQL_SMALL_RESULT', 'SQL_BIG_RESULT', 'QUICK', 'SQL_BUFFER_RESULT', 'SQL_CACHE', 'SQL_NO_CACHE', 'SQL_CALC_FOUND_ROWS', 'WITH',
'OUTFILE', 'DUMPFILE',
],
];

Expand Down
6 changes: 5 additions & 1 deletion classes/db/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,11 @@ public function executeS($sql, $array = true, $use_cache = true)
}

// This method must be used only with queries which display results
if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc|checksum)\s#i', $sql)) {
if (
!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc|checksum)\s#i', $sql)
|| stripos($sql, 'outfile') !== false
|| stripos($sql, 'dumpfile') !== false
) {
throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
}

Expand Down

0 comments on commit f82cb30

Please sign in to comment.