mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 17:41:52 +03:00
Check if the MP header contains invalid character
This commit is contained in:
@@ -424,6 +424,16 @@ static int multipart_process_part_header(modsec_rec *msr, char **error_msg) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check if multipart header contains any invalid characters */
|
||||||
|
char *ch = header_name;
|
||||||
|
while(*ch != '\0') {
|
||||||
|
if (*ch < 33 || *ch > 126) {
|
||||||
|
*error_msg = apr_psprintf(msr->mp, "Multipart: Invalid part header (contains invalid character).");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
ch++;
|
||||||
|
}
|
||||||
|
|
||||||
/* extract the value value */
|
/* extract the value value */
|
||||||
data++;
|
data++;
|
||||||
while((*data == '\t') || (*data == ' ')) data++;
|
while((*data == '\t') || (*data == ' ')) data++;
|
||||||
|
|||||||
Reference in New Issue
Block a user