Back to list

Information Disclosure via X-DiagInfo Header

Description

The 'X-DiagInfo' header can contain diagnostic or debug-related details about the server, environment, or application state. Attackers who gain access to this information may discover internal paths, error messages, or other sensitive operational data that could be leveraged for more targeted attacks. Exposing diagnostic info can aid malicious actors in pinpointing misconfigurations, identifying outdated software components, or developing highly specific exploits. Ultimately, disclosing such internals weakens the security posture by granting adversaries additional insight into the application's architecture and potential vulnerabilities.

Remediation

Remove or sanitize the 'X-DiagInfo' header in production environments to avoid leaking sensitive diagnostic details. Configure your web server, application framework, or middleware components to suppress debug messages and to handle errors without returning diagnostic data in headers. Ensure that reverse proxies or load balancers are not inadvertently passing debug headers to clients. Employ a Web Application Firewall (WAF) or intrusion detection system to detect and block requests attempting to harvest or exploit diagnostic information. Regularly review logs, error-handling mechanisms, and configurations to confirm that no internal system details are inadvertently disclosed.

References

https://owasp.org/www-community/attacks/Information_exposurehttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers

Severity

MEDIUM

Owasp

Code: A05:2021

Category: Security Misconfiguration

Classification

CWE-209
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

5.3

CVSS:4.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

5.3