Disabled auto-escape (ARCH3134)
هذا المحتوى غير متوفر بلغتك بعد.
Key typescript.security.disabled-auto-escape · Severity warning · Category security · CWE CWE-79
Turning off auto-escaping in a template engine removes the default XSS protection for all rendered output. Keep auto-escaping on and mark only known-safe content.
Incorrect
Section titled “Incorrect”import nunjucks from "nunjucks";
const env = nunjucks.configure("views", { autoescape: false });res.send(env.render("profile.njk", { bio: req.body.bio }));Correct
Section titled “Correct”import nunjucks from "nunjucks";
const env = nunjucks.configure("views", { autoescape: true });res.send(env.render("profile.njk", { bio: req.body.bio }));Leave autoescape: true on the template engine; only explicitly mark sanitized content when raw HTML is required.