]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
scan outgoing status line for newlines and controls
authorEric Covener <covener@apache.org>
Sun, 26 Apr 2026 16:30:43 +0000 (16:30 +0000)
committerEric Covener <covener@apache.org>
Sun, 26 Apr 2026 16:30:43 +0000 (16:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933359 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_filters.c

index 004c3c2a6bf5c48edd9a285ee542f4e38cef0620..8e5f76102ea307e823130a50c6d99558bf349efd 100644 (file)
@@ -990,6 +990,11 @@ static apr_status_t validate_status_line(request_rec *r)
             r->status_line = apr_pstrcat(r->pool, r->status_line, " ", NULL);
             return APR_EGENERAL;
         }
+        /* Check for newlines and control characters */
+        if (len > 4 && *ap_scan_http_field_content(r->status_line + 4)) {
+            r->status_line = NULL;
+            return APR_EGENERAL;
+        }
         return APR_SUCCESS;
     }
     return APR_EGENERAL;