fix(crypto-csp): use CSPRNG and strict CSP headers to prevent cryptog… - #272
Open
markuszaki wants to merge 1 commit into
Open
markuszaki wants to merge 1 commit into
markuszaki wants to merge 1 commit into
Conversation
…raphic failures (CWE-327/79/602)
Security improvements:
- Cryptography: Replace weak XOR/AES-ECB with AES-256-GCM authenticated encryption
- Use random_bytes() for all cryptographic random generation
- CSP: Implement strict nonce-based Content Security Policy headers
- Remove unsafe-inline, unsafe-eval, and dangerous external script sources
- JavaScript: Move all validation from client-side to server-side
- Remove obfuscated JavaScript and client-side token generation
- Eliminate JSONP endpoints which are inherently vulnerable to CSP bypass
Files modified:
- vulnerabilities/cryptography/source/{low,medium,high}.php
- vulnerabilities/cryptography/source/token_library_high.php
- vulnerabilities/csp/source/{low,medium,high}.php
- vulnerabilities/javascript/source/{low,medium,high}.php
Addresses: CWE-327 (Cryptographic Issues), CWE-79 (XSS), CWE-602 (Client-Side Enforcement)
🏆 DVWA — CTF Patch Score3 / 55 challenges patched
Commit: 🎉 Your result is on the leaderboard — see where you rank! 🏆 |
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.
…raphic failures (CWE-327/79/602)
Security improvements:
Files modified:
Addresses: CWE-327 (Cryptographic Issues), CWE-79 (XSS), CWE-602 (Client-Side Enforcement)