fix: Incorrect Security Stats when using --enableAutoCsp#58
Merged
devversion merged 1 commit intoangular:mainfrom Sep 26, 2025
Merged
fix: Incorrect Security Stats when using --enableAutoCsp#58devversion merged 1 commit intoangular:mainfrom
--enableAutoCsp#58devversion merged 1 commit intoangular:mainfrom
Conversation
devversion
approved these changes
Sep 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the reports webapp, we see a large number of "Security" findings in the runs if we use the
--enableAutoCspflagThis is because in stats.ts, we are counting the number of CSP reports that are seen during the WebDriver session with autoCSP enabled. Even though we are not tracking Trusted Types violations at this moment, we end up counting Trusted Types violations as a part of security findings. This is currently problematic because the version of the
strict-cspHTML transformation library we use generates a lot of false positive Trusted Types violations as a part of the loader script.We will not count any Trusted Types violations as security findings until
strict-cspis updated to no longer produce false positives. This currently aligns with the name of the variable in the checking--numCspViolationsshould count only CSP violations. To make this future-proof, I've separated out CSP and TT findings instats.ts-- and we can start countingnumTrustedTypesViolationsin the future!Thanks to @devversion for noticing this!