Skip to content

feat(core, service-messaging, service-automation, plugin-webhooks)!: webhook deliveries and the flow http node reach only public addresses unless the operator allowlists the target - #34284

Merged
objectstack-fleet[bot] merged 21 commits into
mainfrom
claude/egress-guard-webhooks-http-node
Nov 16, 2026

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no published skill teaches a webhook or flow http node target on an internal address; the rule and its setting are stated in the changeset and the webhooks docs.

维护者速读

  • 改了什么:webhook 投递和流程 http 节点的出站请求,现在只能到达公网地址;要访问本机或内网目标,运维需在 OS_EGRESS_ALLOWED_TARGETS 里明确列出;链路本地与云元数据地址无论如何都不能放行。
  • 为什么改:租户可以自己填写这些请求的目标地址,原先没有任何出站检查,可以借此访问平台内部服务和云元数据。判定的是实际连上的地址(DNS 解析后、字面 IP、带 IPv4 的 IPv6 形式、每一跳重定向都判),所以 DNS 重绑定也拦得住。
  • 风险与回滚:webhook 或流程原本发往内网地址的部署会被拒绝(BREAKING,changeset 有「Who moves」与一行修复:设置 OS_EGRESS_ALLOWED_TARGETS);发往公网目标不受影响。允许列表写错会让启动失败并列出每条错误项。回滚即还原本 PR。
  • 先看:packages/core/src/egress/(策略、地址分类、受保护的 fetch),packages/services/service-messaging 的 HTTP 投递默认 fetch,packages/services/service-automation 的 http 节点内联分支。
  • 两分钟验证:pnpm --filter @objectstack/core exec vitest run src/egress,预期 170 个测试全绿。
  • 需要你做的:无,席位落地

What changes

Rule. An outbound request whose target a tenant can author reaches only public addresses unless the operator's allowlist names the target. Link-local and cloud metadata addresses are never reachable. The rule is judged on the address the connection is actually made to.

  • @objectstack/core/egress (new subpath entry):
    • EgressPolicy: the seam, decided per connected address, host name, organization and source.
    • createEnvEgressPolicy: the open-core default. It admits only globally reachable addresses: every special-purpose range that is not globally reachable is refused (loopback, private (RFC 1918), carrier-grade NAT, link-local, 0/8, ::, multicast, broadcast and reserved, unique-local, local-use NAT64 and the rest), as is any IPv6 address outside 2000::/3. IPv6 forms that carry an IPv4 address (mapped, SIIT, NAT64, 6to4, compat, Teredo) are judged as the IPv4 address they carry.
    • OS_EGRESS_ALLOWED_TARGETS: exact host names, IP addresses or CIDR blocks, comma-separated, with a strict grammar. A malformed or over-broad entry, or a link-local or metadata address, fails the boot and names every bad entry.
    • A guarded fetch: the connector resolves the host, judges every address, connects to the judged address and judges the socket's remote address again. Every redirect hop and every literal IP is judged. Where a name resolves to several judged addresses, they are dialled in turn.
    • The guard sends with its own fetch and proves at install, per guard, that its requests go through its connector. Where that cannot be proven, the install fails the boot and every send is refused before anything leaves; a response over a connection the guard did not judge is refused. The runtime requirement is stated in the changeset and the environment docs.
    • A refusal reads the same whether the target is not public or does not resolve; a policy that gives no verdict is a named refusal, never a pending request.
  • Webhooks and durable flow callouts: the guard is the HTTP outbox dispatcher's default fetch (service-messaging). A refused target dead-letters on its first attempt as EGRESS_REFUSED and is never retried.
  • Flow http node: the inline arm goes through the guard by a new seam (service-automation). A refusal answers http: EGRESS_REFUSED: ….
  • Boot:
    • The messaging, automation and webhook plugins install the guard at init and take an egressPolicy option.
    • One line per policy says the guard is active.
    • plugin-webhooks logs once how many stored sys_webhook rows the guard will refuse.
    • The boot fails if the guard cannot be built.
  • Error-code ledger: registers EGRESS_REFUSED and EGRESS_ALLOWLIST_INVALID under @objectstack/core.
  • Test fixtures: the loopback-dialing automation suites, the showcase flow harness and one QA checklist recipe get OS_EGRESS_ALLOWED_TARGETS through their environment; suites that stubbed the global fetch use a named stand-in (stubbed-fetch-egress.testkit.ts) or an allowlisted loopback receiver. There is no NODE_ENV branch. The dispatcher's fetchImpl option is test-only and outside the rule.

Tests

  • packages/core/src/egress/egress-policy.test.ts and guarded-fetch.test.ts: 170 cases covering address classes, embedded-IPv4 forms, allowlist grammar and boot refusal, connect-time judgement and re-judgement, dial-in-turn, the install-time proof, redirect hops and literal IPs.
  • service-messaging src/http-egress-guard.test.ts: 10 cases (refused target dead-letters once, never retried; public target delivered).
  • service-automation src/builtin/http-node-egress-guard.test.ts: 10 cases (inline arm refused, allowlisted target reached).
  • plugin-webhooks src/webhook-egress-census.test.ts: 8 cases (the boot census of stored rows).

Acceptance notes

  • Scope, as ruled: the first wave is webhooks plus the flow http node.
    • Still unguarded, and named as follow-up: declarative connectors (resilientFetch), the OAuth grant fetches, MCP, embedders and push delivery.
    • The guard connects directly to the judged address, so an HTTP proxy configured through the environment is not used for these requests.
  • Not measured: delivery to a real public target, because there is no direct egress in the implementing container. The public-target controls use an allowlisted stand-in.

Verification

Readings at head dfef79b5ced76e092098e3fca5d20e1f48665503 (implementer, under the verify lock). dfef79b5 changes only the showcase flow test harness relative to a30e3efc6a, where the package suites and ablations were read.

Pins, package suites, ablations, gates and the dogfood battery
  • New pins (at a30e3efc6a): core egress 170/170, service-messaging http-egress-guard 10/10 and http-sender-bodyless 19/19, service-automation http-node-egress-guard 10/10, plugin-webhooks census 8/8.
  • Full package suites (at a30e3efc6a): core 3574/3574, service-messaging 1001/1001, service-automation 4050/4050, plugin-webhooks 322/322, spec 27025 passed + 1 todo. Typecheck of all five: exit 0.
  • @objectstack/example-showcase (at dfef79b5): 545/545. The showcase fan-out pair red at a30e3efc6a (2 failed, 25 passed) is green at dfef79b5 (27/27): its harness now dials an allowlisted loopback receiver instead of stubbing the global fetch.
  • Ablations: 20 legs through scripts/ablation-replace.mjs, each anchor hit, each leg red, each restored (blob == HEAD, git diff HEAD empty): the never tier (5 legs), the public-only classification (4), dial-in-turn, the socket re-judgement, the per-installer logger, the census projection and bound (2), the install-time proof (3), the named refusal on a missing verdict, and the unresolved-host text and retry (2).
  • dispatch-gates --commands ∪ --ran at dfef79b5: 145 derived, 145 run, 0 NOT-MEASURED, 0 UNRUN. check-platform-checklist --changed-from origin/main: 20 anchors judged, 0 lost.
  • Dogfood battery (pnpm --filter @objectstack/dogfood test, no shard, no path) at dfef79b5: Test Files 473 passed | 3 skipped (476), Tests 4003 passed | 42 skipped (4045), no failures.
  • CI at dfef79b5: 69 check-runs, 60 success, 9 skipped, 0 failing.

🤖 Generated with Claude Code

https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f

…ts off non-public addresses

Claude-Session: https://claude.ai/code/session_017xRBcRQTKjEKNxvpzPCbbc
Co-authored-by: Claude <noreply@anthropic.com>
…allowlisted targets

Claude-Session: https://claude.ai/code/session_017xRBcRQTKjEKNxvpzPCbbc
Co-authored-by: Claude <noreply@anthropic.com>
…outbound-request guard refuses

Claude-Session: https://claude.ai/code/session_017xRBcRQTKjEKNxvpzPCbbc
Co-authored-by: Claude <noreply@anthropic.com>
…ry prefix-matching core alias

Claude-Session: https://claude.ai/code/session_017xRBcRQTKjEKNxvpzPCbbc
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 13 package(s): @objectstack/core, @objectstack/driver-memory, @objectstack/driver-sql, @objectstack/metadata, @objectstack/knowledge-memory, @objectstack/knowledge-ragflow, @objectstack/plugin-dev, @objectstack/plugin-hono-server, @objectstack/plugin-webhooks, @objectstack/runtime, @objectstack/service-automation, @objectstack/service-messaging, @objectstack/spec, touching 114 documentable anchor(s). ⚠️ 13 changed file(s) yielded no anchor (packages/core/package.json, packages/core/src/egress.ts, packages/drivers/driver-memory/vitest.config.ts, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

28 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json d01f399e3b741c8e0d54b811b5d6e29551151509.

⛔ 11 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 13 changed file(s) yielded no anchor (packages/core/package.json, packages/core/src/egress.ts, packages/drivers/driver-memory/vitest.config.ts, …) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: organization_id (literal, 41 pages)
  • 42 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 189 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json d01f399e3b741c8e0d54b811b5d6e29551151509 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from c13c83793faf5d2c5ae2828423da17800b06a797 — the merge of head dfef79b5ced76e092098e3fca5d20e1f48665503 into base d01f399e3b741c8e0d54b811b5d6e29551151509, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c13c83793faf5d2c5ae2828423da17800b06a797 && git checkout c13c83793faf5d2c5ae2828423da17800b06a797
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d01f399e3b741c8e0d54b811b5d6e29551151509 dfef79b5ced76e092098e3fca5d20e1f48665503 && git checkout -B drift-repro d01f399e3b741c8e0d54b811b5d6e29551151509 && git merge --no-ff dfef79b5ced76e092098e3fca5d20e1f48665503

node scripts/docs-audit/affected-docs.mjs --json d01f399e3b741c8e0d54b811b5d6e29551151509

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs d01f399e3b741c8e0d54b811b5d6e29551151509 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ebhooks-http-node

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…request rule they now ship

The webhooks page described refusing non-public targets as future work; it
now states the shipped rule: the default refusal, the allowlist and its
grammar, that link-local and metadata addresses are never allowlistable,
that every redirect hop and the connected address are judged, and that a
refusal dead-letters as EGRESS_REFUSED. The flows page states the same rule
where the http node is documented.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…its loopback receiver

The suite dials a receiver on loopback through the real, guarded fetch; it
allowlists that target through the environment the way an operator does,
scoped to the suite, like the branch's other loopback suites.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 0d81ccb · 2026-11-16T06:02Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0d81ccbec6ebb37c26ec7e877e788a95dccff86b
Local-runs: none
Scope: docs/qa/platform-checklist/areas/automation.json packages/core/package.json packages/core/src/egress.ts packages/core/src/egress/address.ts packages/core/src/egress/egress-policy.test.ts packages/core/src/egress/guarded-fetch.test.ts packages/core/src/egress/guarded-fetch.ts packages/core/src/egress/policy.ts packages/core/tsup.config.ts packages/drivers/driver-memory/vitest.config.ts packages/drivers/driver-sql/vitest.config.ts packages/metadata/vitest.config.ts packages/plugins/knowledge-memory/vitest.config.ts packages/plugins/knowledge-ragflow/vitest.config.ts packages/plugins/plugin-dev/vitest.config.ts packages/plugins/plugin-hono-server/vitest.config.ts packages/plugins/plugin-webhooks/src/webhook-egress-census.test.ts packages/plugins/plugin-webhooks/src/webhook-egress-census.ts packages/plugins/plugin-webhooks/src/webhook-outbox-plugin.ts packages/plugins/plugin-webhooks/vitest.config.ts packages/runtime/vitest.config.ts packages/services/service-automation/src/builtin/http-node-channel-signing.test.ts packages/services/service-automation/src/builtin/http-node-egress-guard.test.ts packages/services/service-automation/src/builtin/http-node-signing.test.ts packages/services/service-automation/src/builtin/http-node-slot-credential.test.ts packages/services/service-automation/src/builtin/http-nodes.test.ts packages/services/service-automation/src/builtin/http-nodes.ts packages/services/service-automation/src/builtin/index.ts packages/services/service-automation/src/plugin.ts packages/services/service-automation/vitest.config.ts packages/services/service-messaging/src/http-dispatcher.ts packages/services/service-messaging/src/http-egress-guard.test.ts packages/services/service-messaging/src/http-sender-bodyless-33895.test.ts packages/services/service-messaging/src/http-sender.ts packages/services/service-messaging/src/messaging-service-plugin.ts packages/services/service-messaging/vitest.config.ts packages/spec/src/api/error-code-ledger.zod.ts pnpm-lock.yaml + .changeset/egress-guard-webhooks-http-node.md

Read at 2026-11-16T06:11Z. First review of this head; claim: comment 6908738958; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for security#1; reviewed by os-tesla, who neither dispatched nor implemented it.

No prior contract-review record exists for this PR, so no earlier finding id is continued; M1, S1 to S3 and N1 to N3 are all new on this head.

① Derived judgments

  • Declaration. Clause-②: no (narrowing) and Metadata-protocol: none are line-initial on both the PR body and the changeset and agree with the diff: nothing an author can write is added, removed or re-valued; what moves is which destinations two outbound doors may reach, decided by operator environment at boot. The ADR-0087 not-required disposition holds for the same reason.
  • Doors named in the declaration. Webhook deliveries and durable flow callouts have one send site in service-messaging and its default is the guard; the flow http node's inline arm, which is also the durable arm's no-outbox fallback, has one send site in service-automation and it is the guard. No second send site exists in either package or in plugin-webhooks on this head. No shipped plugin reaches either send site without the guard. Held.
  • Decision at the moment of connection. The verdict is taken on the addresses the connection is made to, the connection goes to a judged address without a second resolution, each redirect hop is judged, a policy that throws refuses, and no caller can substitute its own transport. Held.
  • Boot. A malformed or over-broad allowlist fails init in all three plugins; there is no unguarded fallback and no NODE_ENV branch. Held.
  • Controls. Each refusal family has a paired control that delivers (allowlisted address, allowlisted host, allowed redirect, non-refusal transport failure still retried), the implementer's ablation of the refusal turned the three sending suites red, and the fixtures open loopback through the environment only. The readings in the PR body were taken at 28edf362a; the two later commits and the merge are covered by this head's CI, not by those readings.
  • The rule's never tier and its "public" word. Not held as declared: M1 and S1 below.

② Semver level

patch on all five packages with the BREAKING banner, the Who-moves paragraph and the one-line fix: correct for a non-protocol narrowing under AGENTS.md (the level follows the metadata kind, which is none). The new @objectstack/core/egress subpath, the three egressPolicy options and the two ledger codes are additive and ride the same level; undici is a runtime dependency of @objectstack/core and the lockfile agrees.

CI on this head: 69 check-runs, all completed, 60 success, 9 skipped, none failing or pending. The PR is open and mergeable-clean against main.

③ Boundary flags

  • First-wave scope (dev flag). Accepted as ruled for the two named doors. Escalated to the seat: the review inputs carry no tracking reference for the follow-up wave, so the seat confirms it is tracked in the private lane before landing; see S3 for the wording that must not outrun the scope meanwhile.
  • Proxy (dev flag). These requests no longer use an environment-configured HTTP proxy. It is stated in the changeset's For-hosts paragraph; answered, with the note that it is an operator-facing change sitting under a hosts heading.
  • Not measured: a real public target (dev flag). Not accepted as closed: see S2, which is exactly the part a stand-in on one loopback address cannot show.
  • Dogfood battery (dev flag). Owed on the final head; the seat carries the reading before landing.
  • Author. The PR's user.login is objectstack-fleet[bot]; no off-relay author to name.
  • SQL push-down. No new id materialisation and no in-app join. The boot census reads sys_webhook once and judges each row in the application because the judgement needs name resolution, which no query can push down; see N3 for its unbounded read.

④ Design judgment

The narrowing makes real a refusal the platform owed and takes away, at the consumer, only what the declaration names: internal targets need an operator allowlist entry. The seam (one decision per connected address, with host, organization and source, fail-closed) is the right shape and mirrors the datasource connect policy. Against the rule as written, the head does not yet hold in four places. Mechanism-level detail for M1 and S1 is in the sealed notes only.

  • M1 (must-fix) — The rule says cloud metadata addresses are never reachable and can never be allowlisted. The default policy's never tier does not hold that for the whole class the rule names. Complete the tier and pin each added member both ways (refused by default, refused under a covering allowlist entry) with a neighbouring control. Specifics: sealed notes, M1.
  • S1 (should-fix) — The rule's sentence is "only public addresses"; the default policy decides by an enumerated set of classes, and the two do not coincide. Either make the classification answer the sentence, or restate the sentence everywhere as the enumerated classes the Clause-② line already lists. Specifics: sealed notes, S1.
  • S2 (should-fix) — The changeset promises that requests to public targets are unaffected, and the PR body records that delivery to a real public target was not measured. The guard dials one of the addresses it judged and does not fall back to the others, which the bare fetch it replaces did. A public target that answers on more than one address or family can therefore fail where it delivered before. Dial the judged addresses in turn, or state the changed behaviour in Who-moves; add a control with a first address that does not accept and a second that does.
  • S3 (should-fix) — The changeset body and the policy's own header state the rule for every outbound request a tenant can aim, while the scope ruled for this PR is two doors. The release note must claim what ships: scope those sentences to webhook deliveries and the flow http node, as the title, the Clause-② line and the boot line already do. Prose-face and jsdoc only.
  • N1 (nit) — The connect-time re-judgement of the socket's own remote address has no pin; the dial-the-judged-address property is pinned only indirectly, through the controls.
  • N2 (nit) — In webhook-outbox-plugin.ts the new bootEgressCensus sits between bootWebhookTable and its jsdoc, so that comment now documents the wrong method.
  • N3 (nit) — The census reads every sys_webhook row, whole, with no projection or bound; and the default guard keeps the logger of whichever plugin installed it first.

M1 and S1 to S3 are open. A delta read by this reviewer is owed on the next head.

Implemented-by: claude/egress-guard-webhooks-http-node
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: FAIL

… non-public address and every cloud metadata address

- The never-allowlistable tier holds every cloud metadata address the rule
  names, in IPv4, IPv6 and every IPv6 form that carries an IPv4 member,
  including the RFC 6052 layouts under the local-use NAT64 prefix.
- The default policy answers "only public addresses": every special-purpose
  range that is not globally reachable is refused, and so is any IPv6
  address outside global unicast.
- The judged addresses are dialled in turn, so a target that answers on only
  some of its addresses is still reached; every connected socket's remote
  address is judged again.
- The shared default guard logs to each installer's own logger.
- The boot census reads only id, url and organization, in ordered pages, up
  to a bound it reports; its method no longer splits another's jsdoc.
- Rule sentences are scoped to webhook deliveries and the flow http node.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…cloud metadata tier

The changeset, the environment-variable reference and the webhooks and
flows pages state the rule the guard now enforces: only public addresses,
every cloud metadata address never reachable, the judged addresses dialled
in turn, and the rule scoped to webhook deliveries and the flow http node.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…dress, and the allowlist refuses one in any form

- The never tier adds the Akamai (Linode) IPv6 metadata address, pinned
  refused by default and under a covering allowlist entry, beside a
  neighbouring address that entry opens.
- A single-address allowlist entry is refused at boot whenever the connect
  would refuse it as never-allowlistable, in any form it carries.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head e022b2d · 2026-11-16T08:58Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e022b2d6a9b4d58459b0b78bc7a08d0cb51b9824
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts + packages/core/src/egress.ts packages/core/src/egress/address.ts packages/core/src/egress/guarded-fetch.ts packages/core/src/egress/policy.ts packages/core/package.json packages/core/tsup.config.ts packages/plugins/plugin-webhooks/src/webhook-egress-census.ts packages/plugins/plugin-webhooks/src/webhook-outbox-plugin.ts packages/services/service-automation/src/builtin/http-nodes.ts packages/services/service-automation/src/builtin/index.ts packages/services/service-automation/src/plugin.ts packages/services/service-messaging/src/http-dispatcher.ts packages/services/service-messaging/src/http-sender.ts packages/services/service-messaging/src/messaging-service-plugin.ts .changeset/egress-guard-webhooks-http-node.md; read for effect only: the eleven vitest.config.ts edits, pnpm-lock.yaml, the changed and added test suites, docs/qa/platform-checklist/areas/automation.json
Security-touching: yes

Second record on this PR; the first (comment 6908879722) was a FAIL on an earlier head. This head is judged in full. Independence: this session neither dispatched nor implemented the diff. Findings are stated at rule level; specifics are in the sealed notes only.

① Derived judgments

  • What moves from sent to refused. A webhook delivery, a durable flow callout and a flow http node request (inline arm, and the durable arm's no-outbox fallback) whose connected address is not public are refused unless the operator's allowlist names the target; the never tier is refused whatever the allowlist says. Named right by the Clause-② line and the changeset.
  • What the ledger gains. EGRESS_REFUSED and EGRESS_ALLOWLIST_INVALID, both under @objectstack/core, both additive; the derived ErrorCode enum widens by exactly these two and the generated reference pages agree. Named right.
  • Nothing else moves, on the supported Node runtime. Each of the two doors has one send site and it is the guard; plugin-webhooks sends nothing itself; no other door's behaviour changes. Requests to public targets keep their multi-address reach. Held.
  • Not held as declared. The changeset and the boot line state the rule without a runtime condition, and the tree does not make the rule hold unconditionally: M2 below.
  • Decision on what is connected to. Every resolved address is judged before any dial, the dial goes to a judged address with no second resolution, the connected socket's own remote address is judged again, every redirect hop is judged, and forms that carry another address are judged as what they carry. Held where the guard is in the path.
  • Controls. Each refusal family has a paired control that delivers; the never tier is pinned both ways with neighbours; the fixtures open loopback through the environment only, and no production branch reads the test environment. The vitest edits add a source alias and weaken no isolation; the lockfile adds one dependency under core.

② Semver level

patch on all five packages with !, the BREAKING banner, the Who-moves paragraph and its one-line fix, and one ADR-0087 not-required marker: correct under AGENTS.md on main for a non-protocol narrowing (Metadata-protocol: none takes patch and keeps the banner and the disposition). Clause-②: no (narrowing) and Metadata-protocol: none are line-initial on the PR body and the changeset and agree with the diff: nothing an author can write is added, removed or re-valued. The new @objectstack/core/egress subpath, the three egressPolicy options and the two ledger codes are additive and ride the same level.

Check-runs on this head: all completed, each success or skipped, none failing or pending. The PR is open and mergeable-clean.

③ Boundary flags

  • First-wave scope (dev flag). The diff guards two doors and the PR body names the outbound doors that stay unjudged. The ruling behind "as ruled" is not among this review's inputs, so it is escalated: the seat confirms the ruling and that the follow-up wave is tracked in the private lane before landing. Until that wave lands, sibling doors in the same authoring surface remain outside the rule, exactly as the PR body already states.
  • Proxy (dev flag). Answered: now stated under Who moves.
  • Not measured: a real public target (dev flag). The multi-address half is answered by the dial-in-turn pins. The runtime half is not: see M2.
  • Dogfood battery (dev flag). Dogfood Regression Gate is green on this head.
  • Author. objectstack-fleet[bot]; no off-relay author to name.
  • SQL push-down. No new id materialisation and no in-app join. The boot census reads three projected columns in capped, ordered pages and judges in the application because the judgement needs name resolution, which no query can push down.

④ Design judgment

The ledger change holds against its consumers: two additive codes under the owning package, carried by the two error classes the comment cites, neither on a wire envelope. The seam (one decision per connected address with host, organization and source; a throw is a refusal; a malformed or over-broad allowlist fails the boot in all three plugins; no unguarded fallback in the plugin wiring) is the right shape, and the narrowing takes away only what it declares, behind a followable operator opt-in. One part of the contract does not hold.

M1: closed.
S1: closed.
S2: closed.
S3: closed.
N1: closed.
N2: closed.
N3: closed.

  • M2 (must-fix) — The guard is not fail-closed against the process it runs in. Its enforcement depends on a property of the host runtime that install neither establishes nor verifies; where that property is absent a guarded request is sent unjudged while the boot line reports the guard active, and the repository documents deployment targets where the property is not assured. The three sending packages also gain load-time requirements on those targets that Who-moves does not state. Make enforcement independent of that property, or prove it at install and refuse the boot and every send when it cannot be proven; pin it with a case that fails if the request can leave without the policy being asked; state any runtime requirement in the changeset. Specifics: sealed notes, M2.
  • N4 (nit) — The PR title states the rule for tenant-aimed outbound requests in general, while the changeset title, the Clause-② line and the boot line scope it to the two doors; the title is what a squash carries.
  • N5 (nit) — The exported dispatcher keeps a public option, documented for tests, that replaces the guarded transport outright; no production caller passes it, and nothing marks it as outside the rule.
  • N6 (nit) — A host policy that answers no verdict at the second judgement leaves the request pending instead of ending it as a named refusal; nothing is sent.
  • N7 (nit) — The refusal a flow or webhook author reads back tells a non-public target apart from one that does not resolve.

M2 is open. A delta read is owed on the next head.

Implemented-by: claude/egress-guard-webhooks-http-node
Reviewed-by: session_01ASNY8Ywba8ySbMdWvra2vS

VERDICT: FAIL

…e outbound-request guard proves at install that it judges every request it sends, and refuses the boot and every send when it cannot

- The guard sends with undici's own fetch and its connector, and proves at
  install that a request made that way reaches the connector; where it
  cannot, the install rejects (each plugin awaits it, so the boot fails)
  and every send is refused before anything leaves. A response that
  arrives over a connection the policy never judged is refused.
- A policy that gives no verdict refuses, at either judgement.
- A host name that does not resolve reads the same refusal text as a
  refused one, and stays retriable for a webhook delivery.
- The dispatcher's test-only transport option is marked outside the rule.
- Suites that faked the network with a stubbed global fetch now hand the
  http node a named stand-in, or deliver to an allowlisted loopback
  receiver: a stubbed global fetch no longer stands in for the guard.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…lowlisted loopback receiver

The outbound-request guard judges every connection itself, so a stubbed
global fetch no longer stands in for the network: the harness points each
http node's url at a receiver on loopback and allowlists it through the
environment, the way an operator lists an internal target.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot changed the title feat(core, service-messaging, service-automation, plugin-webhooks)!: tenant-aimed outbound requests reach only public addresses unless the operator allowlists the target feat(core, service-messaging, service-automation, plugin-webhooks)!: webhook deliveries and the flow http node reach only public addresses unless the operator allowlists the target Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head dfef79b · 2026-11-16T13:29Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: dfef79b5ced76e092098e3fca5d20e1f48665503
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts + packages/core/src/egress.ts packages/core/src/egress/address.ts packages/core/src/egress/guarded-fetch.ts packages/core/src/egress/policy.ts packages/core/package.json packages/core/tsup.config.ts packages/plugins/plugin-webhooks/src/webhook-egress-census.ts packages/plugins/plugin-webhooks/src/webhook-outbox-plugin.ts packages/services/service-automation/src/builtin/http-nodes.ts packages/services/service-automation/src/builtin/index.ts packages/services/service-automation/src/plugin.ts packages/services/service-messaging/src/http-dispatcher.ts packages/services/service-messaging/src/http-sender.ts packages/services/service-messaging/src/messaging-service-plugin.ts .changeset/egress-guard-webhooks-http-node.md content/docs/deployment/environment-variables.mdx; read for effect only: the changed and added test suites and test kits, the vitest.config.ts edits, pnpm-lock.yaml, docs/qa/platform-checklist/areas/automation.json
Security-touching: yes

Third record on this PR; delta after the FAIL in comment 6912107145 on e022b2d6, and this head is judged in full. Independence: this session neither dispatched nor implemented the diff. Findings are stated at rule level; specifics are in the sealed notes only.

① Derived judgments

  • What moves from sent to refused. Unchanged from the declaration: a webhook delivery, a durable flow callout and a flow http node request whose connected address is not public are refused unless the operator's allowlist names the target; the never tier is refused whatever the allowlist says. Named right by the Clause-② line and the changeset.
  • Enforcement no longer rests on the host process. The guard sends with its own transport, the same one its install-time proof exercises, and takes nothing from the process's replaceable globals. The proof passes only when a request made that way was handed to the guard's connector and failed with the connector's own answer. Where it does not pass, the install rejects, all three plugin inits await it and fail the boot, and every send is refused before a connection is attempted, including on a guard taken without the install step. Each send also refuses a response that arrived over a connection its own connector did not judge. Held.
  • Pins for it. A runtime whose transport does not route through the connector: install refused, send refused, nothing arrives, the policy is never asked. A transport that stops routing after the proof: the response is refused. A control in the real runtime delivers and is judged before it leaves. The implementer reports each red under ablation.
  • Runtime requirement. Stated in the changeset under its own heading, in the environment reference next to the allowlist setting, and in the guard's jsdoc and the three plugin init comments. Held.
  • What a refusal reads. One text for every cause; a policy that answers no verdict ends as a named refusal; a host name that does not resolve reads the same text and stays retriable. The ledger's sentence for the code has not followed: S4.
  • Callers. The install is now asynchronous; its three callers await it and no other caller exists in the tree. Suites that faked the network through the global now take a named stand-in or an allowlisted loopback receiver through the environment; no production branch reads the test environment.

② Semver level

patch on all five packages with !, the BREAKING banner, the Who-moves paragraph and its one-line fix, and one ADR-0087 not-required marker: correct under AGENTS.md on main for a non-protocol narrowing. Clause-②: no (narrowing) and Metadata-protocol: none are line-initial on the PR body and the changeset and agree with the diff. The asynchronous install and the new readiness member on the guard are additive on a subpath that is new in this same PR. The ledger gains exactly two additive codes under @objectstack/core; unchanged by this round.

Check-runs on this head: all completed, each success or skipped, none failing or pending. The PR is open.

③ Boundary flags

  • First-wave scope (dev flag). Still escalated: the ruling behind "as ruled" is not among this review's inputs, so the seat confirms the ruling and that the follow-up wave is tracked in the private lane before landing. The PR body names the doors that stay outside the rule.
  • Proxy (dev flag). Answered: stated under Who moves.
  • Not measured: a real public target (dev flag). The runtime half is now answered by the install-time proof and its pins; the multi-address half by the dial-in-turn pins. Delivery to a real public target stays unmeasured and is declared so.
  • Test-only transport option (dev flag). Answered: marked in its jsdoc as tests only and outside the rule; no production caller passes it.
  • Dogfood battery (dev flag). Dogfood Regression Gate is green on this head.
  • Author. objectstack-fleet[bot]; no off-relay author to name.
  • SQL push-down. No new id materialisation and no in-app join in this round; the boot census is unchanged.

④ Design judgment

The remedy chosen for M2 is the stronger of the two asked: enforcement is made independent of the host property and is also proven at install, with a per-send check behind it. The proof exercises the path the sends take, cannot be satisfied by a transport that skips the connector, and fails closed at boot and at every send. The ledger change still holds against its consumers as two additive codes; its prose for one of them is now behind the tree.

M2: closed.
N4: closed.
N5: closed.
N6: closed.
N7: closed.

  • S4 (should-fix) — The ledger's sentence for EGRESS_REFUSED says the code names a target that is not public and not allowlisted, and the webhooks, flows and environment pages say such a delivery dead-letters at once. On this head the same code and text are also what a host name that does not resolve records, where the delivery stays retriable, and what a guard that cannot prove enforcement and a policy with no verdict produce. Restate the code's meaning in the ledger comment and in the three pages as the changeset already does, so an operator reading the code does not take a mistyped public host for an allowlist problem.
  • N8 (nit) — With the text unified, a webhook author can still tell a non-resolving host from a non-public one by the delivery's recorded state, since one is retried and the other is final; the connector comment says the author cannot tell them apart. The changeset declares the retry. The seat confirms the residual is accepted, and the comment is scoped to the text.
  • N9 (nit) — The boot refusal for an unproven guard carries no registered code while its sibling boot refusal does; and the deployment page that lists non-Node hosted doors does not point at the new runtime requirement.
  • N10 (nit) — No case replaces the process's global fetch under the real guard and asserts it is never called; the property holds by construction and a revert would turn the two transport cases red, but only indirectly.

S4 and N8 to N10 are open and do not block.

Implemented-by: claude/egress-guard-webhooks-http-node
Reviewed-by: session_01ASNY8Ywba8ySbMdWvra2vS

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

席位核对

ACCEPT at Head-sha: dfef79b5ced76e092098e3fca5d20e1f48665503 (2026-11-16T14:19Z). Landed by the seat after clock-out (brief 6917513579) on the maintainer's word 「复审通过,你是不是可以把他入队了」.

  • Shape:
    • No-card order from the security#1 seat, ruling B′ (env allowlist, redirects judged per hop, first wave = webhook deliveries and the flow http node, no new lint gate).
    • 52 paths: the @objectstack/core/egress entry, the three sending plugins, the error-code ledger, test fixtures, docs, one changeset. Not governed.
    • Clause-②: no (narrowing), BREAKING with its Who-moves and one-line fix, patch on the five packages, ADR-0087 marker not-required, Metadata-protocol: none.
  • Rule: webhook deliveries and the flow http node reach only public addresses unless the operator's allowlist names the target; link-local and cloud metadata addresses can never be allowlisted; the verdict is taken on the address connected to, on every redirect hop, and the guard proves at install that its sends go through it, failing the boot and every send when it cannot.
  • Gates:
    • CI on this head: 62 success, 11 skipped, 0 failing.
    • Locally: the egress pins 170/170 and the four package suites green; the showcase suite 545/545 on this head; 20 ablation legs, each red and restored; dispatch-gates 145 derived, 145 run, 0 NOT-MEASURED, 0 UNRUN.
    • Dogfood battery on this head: Tests 4003 passed | 42 skipped (4045), no failures.
  • Review: at CONTRACT_REVIEW_TIER: review#2 FAIL 6908879722; review#1 FAIL 6912107145 at e022b2d6; review#1 PASS 6917951594 on this head, with no must-fix.
  • Accepted deviations (follow-ups, the head does not move): S4 (restate what EGRESS_REFUSED covers in the ledger comment and the webhooks, flows and environment pages, as the changeset does); N8 (the attempt-count residual between a non-public and an unresolvable webhook target: kept as shipped, the delivery retry for an unresolvable host is declared in the changeset; the residual and its options are in the private record for the maintainer's ruling, and the connector comment is to be scoped to the text); N9 (a registered code for the unproven-guard boot refusal; a pointer from the hosted-doors page to the runtime requirement); N10 (a direct pin that a replaced global fetch is never called).
  • Scope: the second wave (declarative connectors, OAuth grant fetches, MCP, embedders, push) is tracked in the private record, to dispatch after this merges.
  • Landing: through the merge queue, by the seat.

Implemented-by: os-dev (security#1 order, session_017xRBcT1w3zpekijraHJE4f) · Reviewed-by: review#2 (session_01L9qibxTeW8xHnxoHxWNHWW), review#1 (session_01ASNY8Ywba8ySbMdWvra2vS).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 14:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit c37e47a Nov 16, 2026
74 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/egress-guard-webhooks-http-node branch November 16, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants