mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-06 06:16:51 +03:00
Fix file upload JSON audit log entry
Each uploaded file is a separate yajl array, but we forgot to open the a map for the proper k/v pairs. This fixes issue #1173.
This commit is contained in:
committed by
Felipe Zimmerle
parent
a2bb610d7c
commit
f2ef2017f1
@@ -1364,10 +1364,12 @@ void sec_audit_logger_json(modsec_rec *msr) {
|
|||||||
for(cfiles = 0; cfiles < msr->mpd->parts->nelts; cfiles++) {
|
for(cfiles = 0; cfiles < msr->mpd->parts->nelts; cfiles++) {
|
||||||
if (parts[cfiles]->type == MULTIPART_FILE) {
|
if (parts[cfiles]->type == MULTIPART_FILE) {
|
||||||
if(parts[cfiles]->filename != NULL) {
|
if(parts[cfiles]->filename != NULL) {
|
||||||
|
yajl_gen_map_open(g);
|
||||||
yajl_kv_int(g, "file_size", parts[cfiles]->tmp_file_size);
|
yajl_kv_int(g, "file_size", parts[cfiles]->tmp_file_size);
|
||||||
yajl_kv_string(g, "file_name", log_escape(msr->mp, parts[cfiles]->filename));
|
yajl_kv_string(g, "file_name", log_escape(msr->mp, parts[cfiles]->filename));
|
||||||
yajl_kv_string(g, "content_type", parts[cfiles]->content_type ? parts[cfiles]->content_type : "<Unknown Content-Type>");
|
yajl_kv_string(g, "content_type", parts[cfiles]->content_type ? parts[cfiles]->content_type : "<Unknown Content-Type>");
|
||||||
total_size += parts[cfiles]->tmp_file_size;
|
total_size += parts[cfiles]->tmp_file_size;
|
||||||
|
yajl_gen_map_close(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user