Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Boefje WebpageAnalysis reports absence of HSTS on wrong web asset in report #3991

Open
okoeroo opened this issue Dec 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@okoeroo
Copy link

okoeroo commented Dec 28, 2024

The WebpageAnalysis boefje reports the the absence of HSTS on the wrong asset. This is likely caused by the way python requests (and session) work by default. The default behaviour is to follow a Location header before getting the header data and run a report.

To reproduce

  1. Enable WebpageAnalysis
  2. Scan a resource where the first URI provides an HSTS header, but sets a Location to an asset without an HSTS header. In this case, where the security.txt is hosted.
  3. Run a report.
  4. Finding observed: KAT-HSTS-VULNERABILITIES @ Strict-Transport-Security @ https://dopingautoriteit.nl:443/security.txt @ 136.144.185.174

Example site:

Expected behavior
I expected the finding to be on the asset "https://www.dopingautoriteit.nl:443/security.txt" in the report.

OpenKAT version
Branch main
Commit 945ba6e
Time of checkout: Dec 21, 2024

Also:
Tag: v1.17.0

@okoeroo okoeroo added the bug Something isn't working label Dec 28, 2024
@underdarknl
Copy link
Contributor

In my tests I see the following HSTS finding for "https://dopingautoriteit.nl:443/security.txt"

  • The HSTS should include subdomains.

And the following for "https://www.dopingautoriteit.nl:443/security.txt" to which we where redirected.

  • The website does not use HTTP Strict Transport Security (HSTS). HSTS ensures that browsers can only access the website using encryption (HTTPS).

When also enabling the security_txt boefje, we see the content of the url https://www.dopingautoriteit.nl/.well-known/security.txt file being ingested, where it should correctly identify the 404 being returned.
This PR should handle the 404 cases:
#2556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants