Repository navigation
Remove ESAPI's hardcoded sample Encryptor.MasterKey/MasterSalt - #3206
Open
terryozaki-wq wants to merge 1 commit into
Open
terryozaki-wq wants to merge 1 commit into
terryozaki-wq wants to merge 1 commit into
Conversation
…sterSalt ESAPI.properties shipped with ESAPI's own publicly-documented sample values (Encryptor.MasterKey=tzfztf56ftv, Encryptor.MasterSalt=123456ztrewq) still in place, despite the file's own comment warning "Do NOT forget to replace these with your own values!". A hardcoded, publicly-known "secret" shipping in config is a standing finding for any secret scanner and a latent footgun for future code. Confirmed via direct codebase search that this repo never calls ESAPI.encryptor() - the only ESAPI usage anywhere is ESAPI.encoder(), for SQL/HTML sanitization in Utility.java. ESAPI's DefaultSecurityConfiguration.getMasterKey()/getMasterSalt() are separate, lazily-invoked methods (only reachable through the encryptor path) that already fail closed with a clear ConfigurationException if the property is missing or empty - so leaving them unset is safe today and safe if an encryptor call is ever added later, forcing whoever adds it to supply a real key rather than silently inheriting ESAPI's own sample value. Added UtilitySanitizerUnitTests to behaviorally confirm ESAPI.encoder()-backed Utility.inputSanitizer()/inputSQLSanitizer() still work correctly with the properties commented out (previously untested). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Summary
ESAPI.propertiesshipped with ESAPI's own publicly-documented sample values (Encryptor.MasterKey=tzfztf56ftv,Encryptor.MasterSalt=123456ztrewq) still in place, despite the file's own comment warning "Do NOT forget to replace these with your own values!". A hardcoded, publicly-known "secret" shipping in config is a standing finding for any secret scanner and a latent footgun for future code.ESAPI.encryptor()— the only ESAPI usage anywhere isESAPI.encoder(), for SQL/HTML sanitization inUtility.java.DefaultSecurityConfiguration.getMasterKey()/getMasterSalt()are separate, lazily-invoked methods (only reachable through the encryptor path) that already fail closed with a clearConfigurationExceptionif the property is missing or empty — so leaving them unset is safe today, and safe if an encryptor call is ever added later, since it forces whoever adds it to supply a real key.Test plan
UtilitySanitizerUnitTestsbehaviorally confirmsESAPI.encoder()-backedUtility.inputSanitizer()/inputSQLSanitizer()still work correctly with the properties commented out — 6/6 passing.🤖 Generated with Claude Code