Skip to content

fix(guardian): judge every URL in a command at the egress annotator - #515

Open
drk-ram wants to merge 1 commit into
GenAI-Security-Project:integrationfrom
drk-ram:fix/egress-annotator-all-urls-470
Open

drk-ram wants to merge 1 commit into
GenAI-Security-Project:integrationfrom
drk-ram:fix/egress-annotator-all-urls-470

Conversation

@drk-ram

@drk-ram drk-ram commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

What changed

The egress annotator in the AGT Guardian now inspects every URL in a shell command instead of only the first. It answers the origin when all URLs agree, and the unresolvable sentinel when they differ or when the command carries --resolve, --connect-to, a proxy or unix-socket option, or a proxy environment prefix. An allowlisted decoy in a Referer header or -e value no longer hides the real destination.

Which issue does this implement

Closes #470

  • This is an editorial correction (typo, grammar, link, formatting) with no change in
    meaning, so it needs no issue

Base branch

  • integration, because this touches the specification, schemas, a reference
    implementation, an adapter, tests, or CI
  • main, because every changed path is on the documentation lane allowlist in
    CONTRIBUTING.md

Type of change

  • Specification change (schema, hooks, events, AgBOM)
  • Reference implementation or adapter
  • Documentation
  • Tooling or CI
  • Governance (licensing, security policy, contributor docs)

I tested this

  • I synced my branch with the base branch before opening this
  • uv run pytest -v passes on my machine
  • uv run mkdocs build --strict passes on my machine

Commands and results, on Windows x64 with Bun 1.4.4 (ACS_OPA_PATH set):

  • bun test packages/guardian/test/annotate-egress.test.ts: 88 pass, 0 fail
  • bun test packages/guardian/test/server.test.ts: the six new end-to-end denial tests pass. One test fails, "strips this repo's absolute root out of a real error message", which this change does not touch (Windows path handling).
  • bun run typecheck: clean
  • uv run pytest -q: 1200 passed, 10 failed, 20 errors. The failures and errors are symlink, subprocess and timing tests in test_fetch_roadmap, test_overrides, test_pr_intake_workflow, test_publish_schemas and test_closing_choice, which this Windows machine cannot run. This change touches only TypeScript under reference-implementations/agt.
  • uv run mkdocs build --strict: passes

Checklist

  • Commits are signed off with git commit -s (required by the DCO)
  • Prose follows STYLE.md
  • No secrets, tokens, or internal URLs in the diff

Security

  • This change has no security impact

This closes an egress-gate bypass: a command with an allowlisted URL in a header or option value was allowed although the request went to an off-list host. The change only narrows what the annotator allows. It over-blocks any command that carries a URL and a proxy or --resolve style option, which is the direction the module already chooses to fail in.

annotateEgressDestination took the first http(s) URL in a raw command, so
an allowlisted URL in a Referer or Origin header, a -e value, a user-agent
string or a -d body hid the real destination and the gate allowed it.

Match every URL and answer the origin only when all of them agree. Two
origins, or any URL the unambiguous-authority test refuses, answer
AMBIGUOUS_DESTINATION so the gate denies. A command that carries --resolve,
--connect-to, a proxy or unix-socket option, or a proxy environment prefix
gets the same sentinel, because those move the connection without naming a
second URL.

Adds the decoy rows to the curl corpus, unit tests for both classes, and
end-to-end denials through the shipped manifest and allowlist.

Closes GenAI-Security-Project#470

Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Thanks for this. It is queued rather than ignored. A lead has not reviewed this pull request yet. A lead will read it when they have time, and we can't promise a date. Nothing here is rejected. If a check below fails, please fix it. A pull request that waits a long time may be closed, and you can reopen it later.

@acs-board-reconciler acs-board-reconciler Bot moved this from Needs triage to In progress in ACS Project Tracker Nov 7, 2026

This branch has not been deployed

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

Labels

status:needs-triage Not yet triaged. Applied by the issue forms

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

[Bug] The egress annotator judges the first URL in a command, so an allowlisted URL in a header or option value hides the real destination

1 participant