π‘οΈ Sentinel: Fix XXE vulnerability in SVG parser - #21
Conversation
- Initializes `XMLDocument` with `.nodeLoadExternalEntitiesNever` in `SVGParser.swift`. - Prevents XML External Entity (XXE) attacks when parsing untrusted SVG files. - Hardens the codebase against local file inclusion and SSRF vulnerabilities via malicious SVGs.
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
- Initializes `XMLDocument` with `.nodeLoadExternalEntitiesNever` in `SVGParser.swift`. - Prevents XML External Entity (XXE) attacks when parsing untrusted SVG files. - Hardens the codebase against local file inclusion and SSRF vulnerabilities via malicious SVGs. - Verified `XMLDocument` usage across the codebase; `FileWriter.swift` only writes XML and is safe.
- Initializes `XMLDocument` with `.nodeLoadExternalEntitiesNever` in `SVGParser.swift`. - Prevents XML External Entity (XXE) attacks when parsing untrusted SVG files. - Hardens the codebase against local file inclusion and SSRF vulnerabilities via malicious SVGs. - Verified `XMLDocument` usage across the codebase; `FileWriter.swift` only writes XML and is safe.
- Initializes `XMLDocument` with `.nodeLoadExternalEntitiesNever` in `SVGParser.swift`. - Prevents XML External Entity (XXE) attacks when parsing untrusted SVG files. - Hardens the codebase against local file inclusion and SSRF vulnerabilities via malicious SVGs. - Verified `XMLDocument` usage across the codebase; `FileWriter.swift` only writes XML and is safe. - Verified `parse(contentsOf:)` delegates to the patched method.
π‘οΈ Sentinel: [CRITICAL] Fix XXE vulnerability in SVG parser
π¨ Severity: CRITICAL
π‘ Vulnerability: The SVG parser initialized
XMLDocumentwith empty options, potentially allowing XML External Entity (XXE) attacks if the underlying XML parser processes external entities by default.π― Impact: Attackers could potentially read local files or perform SSRF attacks by supplying malicious SVG content.
π§ Fix: Explicitly disable external entity loading by passing
.nodeLoadExternalEntitiesNeverto theXMLDocumentinitializer.β Verification: Verified code change ensures
optionsare set correctly. (Runtime verification skipped due to CI environment limitations).PR created automatically by Jules for task 4237659465778421869 started by @alexey1312