You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the users of our software is getting a SQLi false positive (id: 942100) on the contents of a PHP SESSION cookie:
Matched Data: n&1 found within REQUEST_COOKIES:_glsr_session: f1348d75e7764ae938dcf4357e9a19f1||1547417923||1547417563"
The contents of the SESSION cookie are as follows:
"||" is used as the delimiter.
The first part is a MD5 encoded string that serves as the session ID. This string is generated with the following code: md5(( new PasswordHash( 8, false ))->get_random_bytes( 32 ));
The second part is the expiry timestamp string. This string is generated with the following code: time() + (24 * 60); // 24 minutes
The third and final part is the expiry reset timestamp string. This string is generated with the following code: time() + (30 * 60); // 30 minutes
I'm guessing that the problem here is being caused by the delimiter, particularly the specific part of the string that is: 1||1. Perhaps libinjection is reading this as 1 OR 1.
Possible temporary solution:
Based on this issue, I have determined that a temporary fix would be to create a custom exception rule to the Modsecurity config:
However, this is less than ideal as I cannot expect all of my users (or at least the ones with modsecurity active on their server) to have the knowledge and ability to do this.
Possible permanent solution:
If my assumptions above are correct, then the permanent solution (other than libinjection improving its detection routines) is to change the delimiter I am using to something else (i.e. __). However, since I do not use modsecurity, it will be impossible for me to verify this.
One of the users of our software is getting a SQLi false positive (id: 942100) on the contents of a PHP SESSION cookie:
The contents of the SESSION cookie are as follows:
"||" is used as the delimiter.
The first part is a MD5 encoded string that serves as the session ID. This string is generated with the following code:
md5(( new PasswordHash( 8, false ))->get_random_bytes( 32 ));
The second part is the expiry timestamp string. This string is generated with the following code:
time() + (24 * 60); // 24 minutes
The third and final part is the expiry reset timestamp string. This string is generated with the following code:
time() + (30 * 60); // 30 minutes
I'm guessing that the problem here is being caused by the delimiter, particularly the specific part of the string that is:
1||1
. Perhaps libinjection is reading this as1 OR 1
.Possible temporary solution:
Based on this issue, I have determined that a temporary fix would be to create a custom exception rule to the Modsecurity config:
SecRuleUpdateTargetById 942100 "!REQUEST_COOKIES:_glsr_session"
However, this is less than ideal as I cannot expect all of my users (or at least the ones with modsecurity active on their server) to have the knowledge and ability to do this.
Possible permanent solution:
If my assumptions above are correct, then the permanent solution (other than libinjection improving its detection routines) is to change the delimiter I am using to something else (i.e.
__
). However, since I do not use modsecurity, it will be impossible for me to verify this.Here is the full error from the error log:
The text was updated successfully, but these errors were encountered: