Skip to content

fix: reject POM entity declarations - #3225

Open
dsfaccini wants to merge 1 commit into
Graphify-Labs:v8from
dsfaccini:fix/pom-xml-entities
Open

fix: reject POM entity declarations#3225
dsfaccini wants to merge 1 commit into
Graphify-Labs:v8from
dsfaccini:fix/pom-xml-entities

Conversation

@dsfaccini

Copy link
Copy Markdown

This pull request was posted by codex-tui using gpt-5.6-sol on behalf of David.

Summary

  • reject Maven POMs containing DTD or entity declarations before ElementTree parsing
  • preserve ordinary default-namespaced POM ingestion
  • add an internal-entity regression test

Fixes #3224.

Validation

  • uv run --frozen pytest tests/test_manifest_ingest.py — pass
  • changed-file pre-commit hooks — pass
  • GRAPHIFY_MAX_WORKERS=2 uv run --frozen graphify update . — pass

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 textgraphify/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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject XML entity declarations in Maven POM ingestion

1 participant