[CODEC-245] Reject malformed Sha2Crypt salt syntax - #445
Open
efegokdemir wants to merge 1 commit into
Open
efegokdemir wants to merge 1 commit into
efegokdemir wants to merge 1 commit into
Conversation
Require the optional rounds clause and salt suffix to use the documented separators and character set. Add regression coverage for malformed rounds text and non-ASCII salt input.
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.
Description
Sha2Cryptaccepted malformed salt strings such as$5$notrounds=1000$asdfasdfand salts containing characters outside the documented alphabet by matching a valid prefix and ignoring the remaining input. The validation pattern is now anchored to the complete salt structure while preserving the existing support for an optional hash suffix and salt truncation.Link to tracking issue
https://issues.apache.org/jira/browse/CODEC-245
Testing
mvn -Dtest=Sha512CryptTest testmvn testmvn -DskipTests verifygit diff --checkAll commands completed successfully. The pre-fix regression run failed because the malformed inputs were accepted; the focused test passes with this change.
Documentation
No documentation changes are required. Existing valid salts, including salts followed by a hash suffix and salts longer than 16 characters, remain covered by the existing tests.
AI disclosure
The open
CODEC-182PR #301 concerns separate Javadoc/prefix validation changes and does not implement the malformed-rounds or invalid-character rejection tracked by CODEC-245.