Manual HTML sanitization detected.
- Rule ID: php_lang_manual_html_sanitization
- Languages: php
- Source: manual_html_sanitization.yml
Sanitizing HTML manually is error prone and can lead to Cross Site Scripting (XSS) vulnerabilities.
❌ Avoid manually escaping HTML:
$html = str_replace("&", "&", $text);
✅ Use a HTML sanitizer:
$html = htmlspecialchars($text);
OWASP Top 10
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=php_lang_manual_html_sanitization
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=php_lang_manual_html_sanitization
Ready to take the next step? Learn more about Bearer Cloud.