]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1933359 from trunk:
authorEric Covener <covener@apache.org>
Sun, 26 Apr 2026 16:32:29 +0000 (16:32 +0000)
committerEric Covener <covener@apache.org>
Sun, 26 Apr 2026 16:32:29 +0000 (16:32 +0000)
scan outgoing status line for newlines and controls

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1933360 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_filters.c

index 732fb8eb6a7310da0ed93b8f0f0652887738bd98..9f7f3fca6b6ac2ecad22983517f814755ff00944 100644 (file)
@@ -1013,6 +1013,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;