Skip to content
vetkitChecksChangelogDocumentation

vetkit.csharp.xss.tainted-html-output

Request input is written to the response as raw HTML (Html.Raw, HtmlString, MarkupString, Response.Write or text/html content) without encoding. This is cross-site scripting.

Last updated:

Suite: Security

csharp

Request input is written to the response as raw HTML (Html.Raw, HtmlString, MarkupString, Response.Write or text/html content) without encoding. This is cross-site scripting.

Category: SECURITY · Engine rule severity: ERROR

How to fix it

Let Razor encode the value (@value), or encode it explicitly with HtmlEncoder.Default.Encode / WebUtility.HtmlEncode. If HTML must be allowed, run it through an HTML sanitizer first.

References

Source: packages/engine/rules/sast/csharp.yml.

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.