github / github/codeql

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

Aperta
#21,022 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, typescript
Ambito
security
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.