Java JAX-RS text/html response XSS from request data
Rule ID: vetkit.java.xss.jaxrs-html-response
A JAX-RS/Micronaut endpoint that produces text/html returns request data without HTML encoding (cross-site scripting).
Last updated:
Suite: Security
java
A JAX-RS/Micronaut endpoint that produces text/html returns request data without HTML encoding (cross-site scripting).
Category: SECURITY · Engine rule severity: ERROR
How to fix it
Render HTML through a template engine with auto-escaping (Qute, Thymeleaf, Mustache) or encode values with the OWASP Java Encoder (Encode.forHtml) before building the response; return JSON for data endpoints.
References
Source: packages/engine/rules/sast/java.yml.
Related checks
- Java servlet XSS: request data written to the response
- Android WebView setAllowFileAccess(true) enabled
- Android WebView onReceivedSslError calls proceed()
- Android WebView addJavascriptInterface with JavaScript on
- Android WebView setAllowUniversalAccessFromFileURLs enabled
- Android MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE files
Check your own repository for this
vetkit runs this rule as part of a repository audit, alongside secret scanning, dependency vulnerabilities, code quality and AI code risk checks. It reads a temporary checkout and never executes your code.
Start with the free Security Quick Scan · See how the platform works
Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.