Headers
Description
- Cache-Control:
- The HTTP 'Cache-Control' header is used to specify directives for caching mechanisms.
- The server did not return (or returned an invalid) 'Cache-Control' header, which means pages containing sensitive information could be stored client-side and then be exposed to unauthorized persons.
Content-Type:
- The Content-Type header was either missing or empty.
X-Content-Type-Options:
- The Anti-MIME-Sniffing header X-Content-Type-Options was not set to ‘nosniff’.
- This allows older versions of Internet Explorer and Chrome to perform MIME-sniffing on the response body, potentially causing the response body to be interpreted and displayed as a content type other than the declared content type. Current and legacy versions of Firefox will use the declared content type (if one is set), rather than performing MIME-sniffing.
Strict-Transport-Security:
- HTTP Strict Transport Security (HSTS) is a web security policy mechanism whereby a web server declares that complying user agents (such as a web browser) are to interact with it using only secure HTTPS connections (i.e. HTTP layered over TLS/SSL).
- HSTS is an IETF standard track protocol specified in RFC 6797.
CookiesSecure:
- A cookie has been set without the secure flag, which means that the cookie can be accessed via unencrypted connections.
CookiesHttpOnly:
- A cookie has been set without the HttpOnly flag, which means that JavaScript code can access the cookie.
- If a malicious script runs on this page, then the cookie will be accessible and can be transmitted to another hacker-controlled site. If this is a session cookie, then session hijacking may be possible.
VersionDisclosure:
- The web/application server is leaking server version information via one or more HTTP response headers.
- Access to such information may facilitate attackers identifying other frameworks/components your web application is reliant upon, and the vulnerabilities of such components may be subject to the leaked information.
Remediation
Cache-Control:
- Whenever possible, ensure the cache-control HTTP header is set with no-cache, no-store, must-revalidate, and that the pragma HTTP header is set with no-cache.
Content-Type:
- Ensure each page sets the specific and appropriate content-type value for the delivered content.
X-Content-Type-Options:
- Ensure that the application/web server sets the Content-Type header appropriately and that it sets the X-Content-Type-Options header to 'nosniff' for all web pages.
- If possible, ensure that the end user uses a standards-compliant and modern web browser that does not perform MIME-sniffing at all or that can be directed by the web application/web server to not perform MIME-sniffing.
Strict-Transport-Security:
- Ensure that your web server, application server, load balancer, etc., are configured to enforce Strict-Transport-Security.
CookiesSecure:
- Whenever a cookie contains sensitive information or is a session token, it should always be passed using an encrypted channel.
- Ensure that the secure flag is set for cookies containing such sensitive information
CookiesHttpOnly:
- Ensure that the HttpOnly flag is set for all cookies.
VersionDisclosure:
- Remove headers disclosing server-side softwares version.
GraphQL Specific
Apollo
Yoga
Awsappsync
Graphqlgo
Graphqlruby
Hasura
REST Specific
Asp_net
Ruby_on_rails
Next_js
Laravel
Express_js
Django
Symfony
Spring_boot
Flask
Nuxt
Fastapi
Configuration
Identifier:
protocol/headers
Examples
Ignore this check
checks:
protocol/headers:
skip: true
Score
- Escape Severity: LOW
Compliance
OWASP: API2:2023
pci: 6.5.10
gdpr: Article-32
soc2: CC6
psd2: Article-95
iso27001: A.14.2
nist: SP800-52
fedramp: SC-28
Classification
- CWE: 200
Score
- CVSS_VECTOR: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:H/RL:O/RC:C
- CVSS_SCORE: 5.1
References
- https://owasp.org/www-community/Security_Headers
- https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#web-content-caching
- https://owasp.org/www-project-web-security-testing-guide/v41/4-Web_Application_Security_Testing/06-Session_Management_Testing/02-Testing_for_Cookies_Attributes.html
- https://www.tenable.com/plugins/was/98618s