Skip to content

feat(java): detect passwords truncated to 72 bytes before BCrypt (CWE-916) - #123

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-bcrypt-truncated-password
Open

feat(java): detect passwords truncated to 72 bytes before BCrypt (CWE-916)#123
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-bcrypt-truncated-password

Conversation

@ai-anant

Copy link
Copy Markdown

Detects password byte arrays truncated to 72 bytes (Arrays.copyOfRange(..., 0, 72) or a MAX_LENGTH/BCRYPT-named constant) before hashing or comparison. Since BCrypt only consumes the first 72 bytes, explicit truncation makes all passwords sharing the same 72-byte prefix equivalent and weakens long credentials. The rule is silent when the full password is passed to the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant