Twig output escaping should not be bypassed without trusted data
Reviewed Drupal Knowledge trusted knowledge, reviewed by a human against authoritative sources
A human reviewed this against registered authoritative sources. It states something about Drupal, not about any one project.
Drupal secure-code documentation says Twig auto-escapes printed strings by default, warns that the raw filter does not escape output and should only be used for trusted data, and states that rendered Twig attributes should be quoted.
Record drupal.security.twig-output-escaping
What this is
- What is this
- trusted knowledge, reviewed by a human against authoritative sources: Twig output escaping should not be bypassed without trusted data
- Why it exists
- A human reviewed authoritative Drupal sources and recorded this as trusted knowledge.
- What makes it authoritative
- A human reviewed this against registered authoritative sources. It states something about Drupal, not about any one project.
- Project scope
- Nothing: this record is about Drupal, not about any one project.
- Recommended next step
- Read the record's own actions and checks.
- Was anything changed
- No. Querying Drupal Knowledge changes nothing.
What is not known
- Nothing was left unstated by this record.
What the record states
| Domains | security, twig, theme, frontend |
|---|---|
| Kind | security-guidance |
| Version applicability | drupal_core: [{'constraint': 'current-documented-secure-code-guidance', 'notes': 'This reviewed rule reflects the current Drupal secure-code documentation for Twig output escaping.', 'status': 'applicable'}] |
Provenance
This record's authority is internal to Drupal Knowledge; no external source snapshot stands behind it.
- authoritative_source · drupal-secure-code · Sanitizing on output to avoid Cross Site Scripting (XSS) attacks
https://www.drupal.org/docs/administering-a-drupal-site/security-in-drupal/writing-secure-code-for-drupal
Related records
Only relationships the canonical records already declare. Nothing here is inferred.