Skip to content

Allow external hyperlinks in the upload gauntlet (keep every other external target blocked)#6

Merged
LegalMarc merged 1 commit into
mainfrom
fix/allow-external-hyperlinks
Jul 17, 2026
Merged

Allow external hyperlinks in the upload gauntlet (keep every other external target blocked)#6
LegalMarc merged 1 commit into
mainfrom
fix/allow-external-hyperlinks

Conversation

@LegalMarc

Copy link
Copy Markdown
Contributor

Problem

The hostile-file upload gauntlet rejected every relationship with TargetMode="External". A plain Word hyperlink is exactly such a relationship, so any contract containing a clickable URL was bounced with:

Relationship in 'word/_rels/document.xml.rels' targets an external resource: '…'.

A hyperlink is inert until a human clicks it and never causes a network fetch when the document is parsed or opened, so this control was over-broad relative to its own documented intent ("nothing in the document is permitted to cause a network fetch at parse time").

Fix

Narrow the rejection to an allowlist: permit external targets only for the /hyperlink relationship type. External images (SSRF / NTLM-hash leak on open), subdocuments, attached templates, and OLE links — all of which Word resolves on open — stay rejected. Input-side only; the redline output scan is untouched and stays strict. Corpus ingestion (same gauntlet) is covered.

Tests

  • New: an external hyperlink is accepted.
  • New: an external image is still rejected (allowlist is narrow, not a blanket relaxation).
  • Existing external-OLE / attached-template / macro rejections unchanged.
  • docs/threat-model.md updated to document the exception and why it preserves the parse-time-fetch guarantee.

🤖 Generated with Claude Code

…ternal target blocked

The hostile-file gauntlet rejected every relationship with
TargetMode="External", but a plain Word hyperlink is exactly such a
relationship. That bounced any contract containing a clickable URL with
"...targets an external resource", even though a hyperlink is inert until a
human clicks it and never causes a network fetch when the document is parsed
or opened.

Narrow the rejection to an allowlist: permit external targets only for the
/hyperlink relationship type; external images, subdocuments, attached
templates, and OLE links (all of which Word resolves on open) stay rejected.
This preserves the documented "no network fetch at parse time" guarantee while
unblocking the ubiquitous benign case. Input-side only — the redline output
scan is untouched and stays strict.

Tests: an external hyperlink is now accepted; an external image is still
rejected (allowlist is narrow, not a blanket relaxation).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@LegalMarc
LegalMarc merged commit f85b8ad into main Jul 17, 2026
17 checks passed
@LegalMarc
LegalMarc deleted the fix/allow-external-hyperlinks branch July 17, 2026 20:31
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.

1 participant