Index: modsecurity-apache/apache2/msc_multipart.c
===================================================================
--- modsecurity-apache.orig/apache2/msc_multipart.c	2012-06-15 12:32:21.316004131 +0200
+++ modsecurity-apache/apache2/msc_multipart.c	2012-10-22 16:21:24.234389205 +0200
@@ -653,6 +653,7 @@
             }
         }
         else {
+            msr->mpd->flag_invalid_part = 1;
             msr_log(msr, 3, "Multipart: Skipping invalid part %pp (part name missing): "
                 "(offset %u, length %u)", msr->mpd->mpp,
                 msr->mpd->mpp->offset, msr->mpd->mpp->length);
@@ -944,7 +945,7 @@
 
         if (msr->mpd->flag_header_folding) {
             msr_log(msr, 4, "Multipart: Warning: header folding used.");
-        }        
+        }
 
         if (msr->mpd->flag_crlf_line && msr->mpd->flag_lf_line) {
             msr_log(msr, 4, "Multipart: Warning: mixed line endings used (CRLF/LF).");
@@ -961,9 +962,13 @@
             msr_log(msr, 4, "Multipart: Warning: invalid quoting used.");
         }
 
+        if (msr->mpd->flag_invalid_part) {
+            msr_log(msr, 4, "Multipart: Warning: invalid part parsing.");
+        }
+
         if (msr->mpd->flag_invalid_header_folding) {
             msr_log(msr, 4, "Multipart: Warning: invalid header folding used.");
-        }        
+        }
     }
 
     if ((msr->mpd->seen_data != 0) && (msr->mpd->is_complete == 0)) {
Index: modsecurity-apache/apache2/msc_multipart.h
===================================================================
--- modsecurity-apache.orig/apache2/msc_multipart.h	2012-03-16 13:23:17.667622550 +0100
+++ modsecurity-apache/apache2/msc_multipart.h	2012-10-22 16:21:24.258389323 +0200
@@ -117,6 +117,7 @@
     int                      flag_boundary_whitespace;
     int                      flag_missing_semicolon;
     int                      flag_invalid_quoting;
+    int                      flag_invalid_part;
     int                      flag_invalid_header_folding;
     int                      flag_file_limit_exceeded;
 };
Index: modsecurity-apache/apache2/re_variables.c
===================================================================
--- modsecurity-apache.orig/apache2/re_variables.c	2012-03-16 13:23:17.671622573 +0100
+++ modsecurity-apache/apache2/re_variables.c	2012-10-22 16:21:24.226389170 +0200
@@ -1377,6 +1377,18 @@
     }
 }
 
+/* MULTIPART_INVALID_PART */
+
+static int var_multipart_invalid_part_generate(modsec_rec *msr, msre_var *var, msre_rule *rule,
+    apr_table_t *vartab, apr_pool_t *mptmp)
+{
+    if ((msr->mpd != NULL)&&(msr->mpd->flag_invalid_part != 0)) {
+        return var_simple_generate(var, vartab, mptmp, "1");
+    } else {
+        return var_simple_generate(var, vartab, mptmp, "0");
+    }
+}
+
 /* MULTIPART_INVALID_QUOTING */
 
 static int var_multipart_invalid_quoting_generate(modsec_rec *msr, msre_var *var, msre_rule *rule,
@@ -1429,6 +1441,7 @@
             ||(msr->mpd->flag_lf_line != 0)
             ||(msr->mpd->flag_missing_semicolon != 0)
             ||(msr->mpd->flag_invalid_quoting != 0)
+            ||(msr->mpd->flag_invalid_part != 0)
             ||(msr->mpd->flag_invalid_header_folding != 0)
             ||(msr->mpd->flag_file_limit_exceeded != 0)
         ) {
@@ -2835,6 +2848,17 @@
         VAR_DONT_CACHE, /* flag */
         PHASE_REQUEST_BODY
     );
+
+    /* MULTIPART_INVALID_PART */
+    msre_engine_variable_register(engine,
+        "MULTIPART_INVALID_PART",
+        VAR_SIMPLE,
+        0, 0,
+        NULL,
+        var_multipart_invalid_part_generate,
+        VAR_DONT_CACHE, /* flag */
+        PHASE_REQUEST_BODY
+    );
 
     /* MULTIPART_INVALID_QUOTING */
     msre_engine_variable_register(engine,
Index: modsecurity-apache/modsecurity.conf-recommended
===================================================================
--- modsecurity-apache.orig/modsecurity.conf-recommended	2012-10-22 16:20:21.474077998 +0200
+++ modsecurity-apache/modsecurity.conf-recommended	2012-10-22 16:21:24.258389323 +0200
@@ -70,6 +70,7 @@
 LF %{MULTIPART_LF_LINE}, \
 SM %{MULTIPART_SEMICOLON_MISSING}, \
 IQ %{MULTIPART_INVALID_QUOTING}, \
+IQ %{MULTIPART_INVALID_PART}, \
 IH %{MULTIPART_INVALID_HEADER_FOLDING}, \
 IH %{MULTIPART_FILE_LIMIT_EXCEEDED}'"
 
