Why it matters
Anyone who reads it can mint tokens this service accepts.
How to fix it
Load the key from the environment or a secret store, and rotate the key that was committed.
Example
The rule's own test fixtures, verbatim: the test suite requires the rule to report the first and not the second.
<?php
use Firebase\JWT\JWT;
$token = JWT::encode(['sub' => $userId], "production-signing-key-2026", 'HS256');<?php
use Firebase\JWT\JWT;
$token = JWT::encode(['sub' => $userId], getenv("JWT_SIGNING_KEY"), 'HS256');What TrustIvan reads
Runs on repository scans of PHP source once static analysis is turned on (SAST_RULES and the separately built analyzer image); it is off by default.
Weakness classes and references
Related checks
- Hardcoded password database connection (PHP)
PHPSeverity: High
trustivan-php-hardcoded-password-database-connection - Laravel CSRF except all (PHP)
PHPSeverity: Medium
trustivan-php-laravel-csrf-except-all - Extract request data (PHP)
PHPSeverity: High
trustivan-php-extract-request-data - Phpinfo call (PHP)
PHPSeverity: Medium
trustivan-php-phpinfo-call - XXE libxml NOENT (PHP)
PHPSeverity: High
trustivan-php-xxe-libxml-noent - Display errors enabled (PHP)
PHPSeverity: Medium
trustivan-php-display-errors-enabled
Terms: SAST (static application security testing), Taint analysis, CWE (Common Weakness Enumeration), OWASP Top 10
All static analysis (SAST) checks · The whole catalogue · How this works in TrustIvan · Documentation