fix: reject POM entity declarations - #3225
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Formal verification. No changes could be formally verified in this run.
Graphify review — findings
Hardens _parse_pom against XML entity-expansion attacks by rejecting any POM containing a <!DOCTYPE or <!ENTITY> declaration before handing it to ElementTree, raising a ValueError that surfaces as a parse error with empty nodes/edges rather than parsing untrusted expansion. Adds a test covering the internal-entity rejection path and renames the existing namespaced-POM test for clarity.
Worth a look
- POM parser rejects valid XML comments containing doctype/entity text —
graphify/manifest_ingest.py:273· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1342 functions depend on the 37 functions this change touches.
Health — this change adds coupling hotspots:
- new:
extract()— 520 callers, 43 callees - new:
_rebuild_code()— 113 callers, 50 callees - new:
detect()— 108 callers, 15 callees - new:
dispatch_command()— 2 callers, 123 callees - new:
detect_incremental()— 23 callers, 7 callees - new:
_get_extractor()— 26 callers, 6 callees - new:
_is_sensitive()— 36 callers, 4 callees - new:
classify_file()— 43 callers, 3 callees - …and 13 more — each is listed as a finding
Verification — 1342 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 545 function(s) in the blast radius were not formally verified this run
Formal verification
Could not verify: Could not verify \_parse\_pom.
The verifier did not have enough to check \_parse\_pom, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: not verifiable: all 23 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly ParseError — names the real obstacle, not a sampling gap)
· 21 more finding(s) on lines outside this diff (see the check run).
Summary
ElementTreeparsingFixes #3224.
Validation
uv run --frozen pytest tests/test_manifest_ingest.py— passGRAPHIFY_MAX_WORKERS=2 uv run --frozen graphify update .— pass