CVE-2020-5255 in Symfonyinfo

Summary

by MITRE

In Symfony before version 4.4, when a `Response` does not contain a `Content-Type` header, affected versions of Symfony can fallback to the format defined in the `Accept` header of the request, leading to a possible mismatch between the response's content and `Content-Type` header. When the response is cached, this can prevent the use of the website by other users. This has been patched in version 4.4.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 05/10/2025

This vulnerability in Symfony represents a critical content-type misconfiguration issue that arises from improper handling of HTTP response headers within the framework's caching mechanisms. The flaw occurs when a response lacks an explicit Content-Type header, causing the system to attempt to infer the appropriate content type from the Accept header present in the incoming request. This behavior creates a dangerous mismatch between the actual content being served and the Content-Type header that is declared, potentially leading to security implications when cached responses are subsequently served to different users.

The technical implementation of this vulnerability stems from Symfony's response handling logic where the framework attempts to determine content type dynamically rather than enforcing explicit declaration. When the Accept header contains specific format preferences such as application/json or text/xml, the system may incorrectly assign these formats to responses that contain different content types. This process becomes particularly problematic in cached environments where a response with one content type might be served with a different Content-Type header, creating inconsistencies that can be exploited by malicious actors. The vulnerability is particularly concerning because it operates at the HTTP protocol level, affecting how browsers and other clients interpret and process the responses they receive.

The operational impact of this vulnerability extends beyond simple content rendering issues to potentially compromise application security and user experience. When cached responses are served with incorrect Content-Type headers, users may experience various issues including browser security warnings, failed content parsing, and in more severe cases, potential cross-site scripting vulnerabilities when different content types are incorrectly interpreted. The caching aspect of this vulnerability is particularly dangerous because it means that once an attacker can trigger the problematic response generation, the malicious effects can persist and affect multiple users who access the cached content. This creates a cascading security risk that can compromise the entire application's integrity and user trust.

The fix implemented in Symfony version 4.4 addresses this vulnerability by enforcing explicit Content-Type header declaration and preventing automatic fallback mechanisms that could lead to content-type mismatches. This solution aligns with security best practices outlined in CWE-693, which addresses protection mechanism failures in web applications, and follows ATT&CK techniques related to command and control through content manipulation. Organizations should ensure immediate patching of affected versions and implement monitoring for any cached responses that might still contain incorrect headers. Additionally, developers should adopt defensive coding practices that explicitly set Content-Type headers for all responses and avoid relying on automatic inference mechanisms that could lead to similar vulnerabilities in custom application code.

Responsible

GitHub, Inc.

Reservation

01/02/2020

Moderation

accepted

CPE

ready

EPSS

0.01297

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!