Hardcoded JWT secret detected
- Rule ID: javascript_lang_jwt_hardcoded_secret
- Languages: javascript
- Source: jwt_hardcoded_secret.yml
Description
Code is not a secure place to store secrets, use environment variables instead.
Remediations
Use environment variables
var jwt = require("jsonwebtoken");
var token = jwt.sign({ foo: "bar" }, process.env.JWT_SECRET);
Resources
Associated CWE
OWASP Top 10
Configuration
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=javascript_lang_jwt_hardcoded_secret
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=javascript_lang_jwt_hardcoded_secret
Ready to take the next step? Learn more about Bearer Cloud.