User input in format string detected.
- Rule ID: javascript_lang_format_string_using_user_input
- Languages: javascript
- Source: format_string_using_user_input.yml
Description
If an application includes user input directly in a format string, an attacker can use format specifiers in the user input to produce misleading or fabricated messages.
Remediations
❌ Avoid format strings containing user input:
console.log(`The value was ${req.params.value}`)
✅ Use a literal format string with additional arguments:
console.log("The value was %s", req.params.value)
Associated CWE
Ready to take the next step? Join the Bearer Cloud waitlist.