Incompatibility with @xmldom/xmldom 0.9.x: DOMParser.parseFromString throws on undefined mimeType
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
Direzione di ricerca
Inizia da package.json e lib/utils.js:72, quindi esamina gli altri punti in cui viene chiamato DOMParser.parseFromString e rivedi le PR esistenti #76 e #101. Conferma la scelta della dipendenza e assicurati che il parsing XML non fallisca più con l’intervallo supportato di @xmldom/xmldom; verifica i test pertinenti del progetto, se disponibili.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
[email protected] declares "@xmldom/xmldom": "^0.7.4" (package.json). @xmldom/[email protected] introduced a breaking change to DOMParser.parseFromString() — the mimeType argument is now required and an undefined value throws. Because latest on the npm registry now points at 0.9.10 (LTS is still 0.8.10), any consumer that uses an SCA tool / Renovate / Dependabot to widen the xmldom range past the existing 0.7.x CVE floor (CVE-2026-34601) lands on 0.9.x and breaks at runtime.
Repro
lib/utils.js:72 calls parseFromString with one argument:
```js
factoryForNode: function(xmlString) {
var doc = new DOMParser().parseFromString(xmlString);
// ...
}
```
Under @xmldom/[email protected]:
```
TypeError: DOMParser.parseFromString: the provided mimeType "undefined" is not valid.
at DOMParser.parseFromString (.../@xmldom/xmldom/lib/dom-parser.js:222:9)
at Object.factoryForNode (.../saml/lib/utils.js:72:37)
at Object. (.../saml/lib/saml11.js:12:31)
```
Why this matters now
- The
^0.7.4range made sense at the time of[email protected], but 0.7.x has CVE-2026-34601 (XML injection via unsafe CDATA serialization). Downstream consumers cannot stay on 0.7.x without violating their security policies, so they end up either pinning manually or using package-manager overrides — both of which are fragile. - There are two existing PRs that would address this — #76 (2021) and #101 (Snyk, 2024) — but both have sat untouched. #101 is mergeable with 0 comments after ~2 years.
Suggested fix
Bump @xmldom/xmldom to either:
^0.8.10— matches current LTS, no API changes required (this is what #101 proposes).^0.9.10— matches currentlatest, requires updatingfactoryForNode(and any other call site) to pass an explicit mimeType ('text/xml'or'application/xml').
Option 1 is the minimum safe bump and gets users out of the CVE floor; option 2 is the forward-looking fix.
Happy to send a PR if it would help unblock #101.
Reported during a transitive-dep regression on a downstream project. Filing here as a paper trail since neither prior PR mentions the 0.9.x compat break specifically.
[Written by Claude]
- Lingua principale
- JavaScript
- Stelle
- 73
- Fork
- 89
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di auth0/node-saml
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 10/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
Tutte le issue di auth0/node-saml
Issue simili
-
[Bug] Dev image build fails: `npm install` in the root Dockerfile runs out of memory (exit 134)Forse già presa @andest01 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue hacktoberfest help wanted
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 76/100
pacocartones/free-llm-api-hub#262 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-task risk:low
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
guyellis/http-status-check#512 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/playwright#43327 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/TypeScript#64758 ·
I maintainer di solito rispondono entro 1 giorno