-
-
Notifications
You must be signed in to change notification settings - Fork 422
fix(953100): remove generic SQLSTATE error codes causing false positives #4257
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
Conversation
|
📊 Quantitative test results for language: |
|
Hi @Elnadrion! Thanks for your contribution! |
|
Question: wouldn't this be caught by coreruleset/rules/sql-errors.data Line 81 in 2bd0e9a
|
Sure, I think it would. Should I remove my |
|
Alrighty, I simplified the pattern and removed unnecessary tests 👍 |
|
Thanks for taking a second look. One of the things that I'm not 100% sure is the utility of those errors in the PHP leakage 🤔 This is a file that I've created automatically from the PHP source code, and tried to remove nonsense from it. See https://github.com/coreruleset/coreruleset/blob/main/rules/php-errors.data#L1-L30. I'm maybe more inclined to do coreruleset/rules/php-errors.data Line 30 in 2bd0e9a
What do you think? |
|
Yeah, why not, also totally fine for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for taking a look!
This patch refines rule 953100 (PHP leakage) by removing overly broad markers (
HY000,HY093,HY105,IM001) fromphp-errors.dataand replacing them with context-aware signatures:SQLSTATE[HY000],(HY000/SQLSTATE[HY093]SQLSTATE[HY105]SQLSTATE[IM001]These patterns align with real PDO/ODBC error messages while eliminating false positives caused by random substrings in response bodies (e.g. I had tokens like
hazhhy0004,sim001a). This improves detection accuracy without weakening coverage of genuine leakage events.