Skip to content

harden: disable external XML entity processing in benchmarks.py... - #415

Closed
anupamme wants to merge 1 commit into
D4Vinci:mainfrom
anupamme:fix-repo-scrapling-xxe-defusedxml-lxml-benchmarks
Closed

harden: disable external XML entity processing in benchmarks.py...#415
anupamme wants to merge 1 commit into
D4Vinci:mainfrom
anupamme:fix-repo-scrapling-xxe-defusedxml-lxml-benchmarks

Conversation

@anupamme

Copy link
Copy Markdown

Summary

Harden input handling in benchmarks.py (flagged by semgrep).

Vulnerability

Field Value
ID gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410
Severity HIGH
Scanner semgrep
Rule gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410
File benchmarks.py:9
Assessment Defensive hardening

Description: Found use of the native Python XML libraries, which is vulnerable to XML external entity (XXE)
attacks. The Python documentation recommends the 'defusedxml' library instead. Use 'defusedxml'.
See https://github.com/tiran/defusedxml for more information.

Threat Model Context

This is a CLI tool - exploitation requires the attacker to control arguments or input files passed to the tool.

Changes

  • benchmarks.py

Behavior Preservation

The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.


This patch removes an exploit primitive — a code pattern that, while not independently exploitable today, could be chained with other weaknesses by automated exploit-development tooling. Proactive removal of such primitives raises the bar against increasingly capable automated attack tools.


Automated security fix by OrbisAI Security

…B408.B409.B410 security vulnerability

Automated security fix generated by OrbisAI Security
@D4Vinci

D4Vinci commented Aug 17, 2026

Copy link
Copy Markdown
Owner

This is used for benchmarks locally!

@D4Vinci D4Vinci closed this Aug 17, 2026
@D4Vinci D4Vinci added the AI-Slop A lack of knowledge of the library, with the AI used poorly to create this ticket. label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Slop A lack of knowledge of the library, with the AI used poorly to create this ticket.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants