Skip to content

Conversation

@ginkelsoft-development
Copy link
Owner

Added validation to ensure SEARCH_PEPPER is not empty before generating tokens. This prevents a security vulnerability where tokens would be generated without a pepper, making them vulnerable to rainbow table attacks.

Changes:

  • Added empty pepper validation in Tokens::exact()
  • Added empty pepper validation in Tokens::prefixes()
  • Throw RuntimeException with helpful error message and setup instructions
  • Updated PHPDoc to document the exception

The error message now guides developers to configure the pepper properly with a suggested command: openssl rand -base64 32

Added validation to ensure SEARCH_PEPPER is not empty before generating
tokens. This prevents a security vulnerability where tokens would be
generated without a pepper, making them vulnerable to rainbow table attacks.

Changes:
- Added empty pepper validation in Tokens::exact()
- Added empty pepper validation in Tokens::prefixes()
- Throw RuntimeException with helpful error message and setup instructions
- Updated PHPDoc to document the exception

The error message now guides developers to configure the pepper properly
with a suggested command: openssl rand -base64 32
@ginkelsoft-development ginkelsoft-development merged commit 128c23d into develop Oct 13, 2025
4 of 8 checks passed
ginkelsoft-development added a commit that referenced this pull request Oct 14, 2025
…r-configuration

fix: validate SEARCH_PEPPER configuration before token generation
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.

2 participants