Skip to content

Java: CWE-523 Insecure HSTS configuration#3534

Closed
luchua-bc wants to merge 3 commits into
github:masterfrom
luchua-bc:java-insecure-hsts
Closed

Java: CWE-523 Insecure HSTS configuration#3534
luchua-bc wants to merge 3 commits into
github:masterfrom
luchua-bc:java-insecure-hsts

Conversation

@luchua-bc
Copy link
Copy Markdown
Contributor

@luchua-bc luchua-bc commented May 20, 2020

HSTS (HTTP Strict Transport Security) is a web security policy mechanism that helps to protect websites against man-in-the-middle attacks such as protocol downgrade attacks and cookie hijacking. HSTS is specified in RFC 6797 and is supported by all major browsers and web servers. Missing or incorrect configuration allows unprotected transport of credentials.

HSTS started to be widely accepted and configured in recent years.

This query covers three scenarios of insecure Tomcat configuration:

  1. The filter HttpHeaderSecurityFilter is not configured
  2. The filter is configured but is explicitly disabled
  3. The filter is not mapped to all resources thus doesn't protect all resources

I've tested the query against some GitHub projects, and a test case has been created.

Please consider to merge the PR. Thanks.

@luchua-bc

@luchua-bc luchua-bc requested a review from a team as a code owner May 20, 2020 21:10
@aschackmull
Copy link
Copy Markdown
Contributor

Closing as per github/securitylab#90 (comment)

@luchua-bc luchua-bc deleted the java-insecure-hsts branch June 23, 2020 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants