github / github/codeql

General issue: CWE-116 not reported for unescaped XML output in JavaScript/TypeScript

Ouverte
#21,022 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
question
Langage dominant
CodeQL
Étoiles
10.1k
Forks
2.1k
Merge moyen
2 j 15 h
PR mergées (30 j)
141

Description

**Description**
CodeQL security scan did not recognise the CWE-116 (Improper Encoding or Escaping of Output) in a Sitemap.xml.ts file when unescaped values are embedded into XML output.

**Example**
A sitemap is generated dynamically by interpolating application-derived values
into XML elements:

```ts
function generateSitemap(entries: string[]) {
return `

${entries.map(path => `

${BASE_URL}/${path}

`).join("")}
`;
}
```
Values here are embedded directly into XML elements without escaping.

**Question**
I would like to understand whether this pattern is currently not covered by the JavaScript/TypeScript analysis, or whether the scanning logic intentionally determines that this does not constitute a CWE-116 weakness when generating XML output such as a sitemap.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by reproducing the reported CodeQL result against the Sitemap.xml.ts example and then inspect the JavaScript/TypeScript analysis coverage for XML output. Done means determining whether unescaped XML interpolation is intentionally excluded or should be reported as CWE-116, with the resulting behavior or rationale clearly documented.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, typescript
Domaine
security
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.