Skip to content

fix(http): bound the SSRF pre-check DNS lookup in desktopAwareTransport - #4186

Merged
dgageot merged 1 commit into
docker:mainfrom
trungutt:fix/desktop-proxy-safe-lookup-timeout
Sep 7, 2026
Merged

dgageot merged 1 commit into
docker:mainfrom
trungutt:fix/desktop-proxy-safe-lookup-timeout

Conversation

@trungutt

@trungutt trungutt commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

The one-liner

Before sending a request to a docker.com address through the Docker Desktop transport, desktopAwareTransport does a quick DNS safety check. On some corporate networks that check hangs forever, freezing the whole request. This PR puts a short cap on the check — if it's still stuck after 2 seconds, the request goes through the Desktop transport anyway.

Why the safety check exists

The transport has two ways of sending a request out:

  • Direct: straight to the internet, with strict SSRF guards (it refuses to connect to private IPs, so a malicious DNS answer can't trick it into hitting the internal network).
  • Via Docker Desktop: hands the request to Desktop, which knows about corporate proxies (PAC files) and routes it properly.

Only docker.com / docker.io addresses are allowed to take the Desktop route. Before taking it, the transport double-checks: "does this hostname resolve to normal public internet addresses?" (proxySafe). If DNS says the name points somewhere private — suspicious — it falls back to the guarded direct path. Fail closed, safe by default.

The problem

That double-check asks the local machine's DNS. On locked-down corporate networks, machines often can't resolve internet names at all — only the corporate proxy can. So the check doesn't get a "no", it gets silence:

request to a docker.com host
        │
        ▼
 "is this host safe?" ── asks local DNS ──▶ ⏳ ...no answer, ever...
        │
        ▼
 entire request frozen — even though the Desktop route
 it was about to take works perfectly on this network

The irony: the check was guarding a route that exists precisely for networks where local DNS doesn't work.

The fix

Give the DNS check a 2-second budget, then decide based on how it failed:

DNS check outcome Decision
answers with public IPs Desktop route (unchanged)
answers with private IPs direct, guarded (unchanged)
answers "no such host" direct, guarded (unchanged)
still silent after 2 seconds Desktop route (new: fall open)
caller already gave up direct, guarded (unchanged)

Falling open on silence is safe because the host was already vetted as a docker.com name, and Desktop does its own name resolution and policy on its side — the local DNS answer was never load-bearing for the Desktop route, only a courtesy check.

Why it matters

Without the cap, the hang can be fatal: when embedded in a host application, a startup request frozen in the check can outlive the host's health-check budget and get the process killed. With the cap, the worst case on such a network is a 2-second pause before the request proceeds down the working route.

On networks where a Docker-owned host is reachable only through the
operator-configured upstream, the client-side resolver may hang. The
existing SSRF pre-check blocks the request indefinitely in that case
even though the host is already opted into routing through the Desktop
transport that would have succeeded.

Cap the lookup and fall open only when our own budget expired and the
parent context is still live. NXDOMAIN and other resolver errors keep
the existing fail-closed behaviour.
@aheritier aheritier added area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Sep 7, 2026
@trungutt
trungutt marked this pull request as ready for review September 7, 2026 10:13
@trungutt
trungutt requested a review from a team as a code owner September 7, 2026 10:13
@dgageot
dgageot merged commit a2ce223 into docker:main Sep 7, 2026
16 of 17 checks passed
pull Bot pushed a commit to TheTechOddBug/cagent that referenced this pull request Sep 8, 2026
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
docker-agent 1.134.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>This release adds machine-readable output to debug commands, improves RAG indexing reliability, fixes config handling for removed fields, and includes a large batch of documentation corrections.

## What's New

- Adds `--json` flag to `debug toolsets` and `debug skills` subcommands for machine-readable output
- Accepts positional flavor names on `debug config` (e.g., `docker agent debug config examples/flavors.yaml cheap with-shell`)
- Decouples RAG indexing from the caller timeout via a new `indexing_timeout` config option, preventing large knowledge base indexing from being discarded when the 30s startup budget is exceeded
- Pins the injected docker-agent image to the host CLI version by default in `docker agent eval`

## Bug Fixes

- Fixes config upgrade hinting at removed fields (e.g., `safer`) instead of silently re-adding them
- Always records the resolved agent image in saved eval run JSON
- Bounds the SSRF pre-check DNS lookup in `desktopAwareTransport` to 2 seconds to prevent hangs on corporate networks
- Replaces removed `github-copilot/gpt-4.1` model with `gpt-5.5` in the models snapshot

## Technical Changes

- Freezes config schema v15 as an immutable package and advances `latest` to v16
- Refreshes the embedded models.dev catalog snapshot (129 models added, 67 removed, ~322 updated)
- Corrects 53 documentation inaccuracies across 34 files covering SDK examples, CLI flags, telemetry, permissions, and integrations
---

## What's Changed
* docs: update CHANGELOG.md for v1.133.0 by @docker-read-write[bot] in docker/docker-agent#4171
* feat(rag): decouple indexing from caller timeout via indexing_timeout config (#4073) by @aheritier in docker/docker-agent#4172
* feat(debug): add --json flag to debug toolsets and skills by @dgageot in docker/docker-agent#4173
* feat(debug): accept positional flavors on `debug config` by @dgageot in docker/docker-agent#4174
* chore: refresh models.dev snapshot (+129 -67 ~322) by @github-actions[bot] in docker/docker-agent#4183
* docs: auto-update for merged PRs (2026-09-05) by @aheritier in docker/docker-agent#4178
* fix(config): hint at removed fields instead of re-adding them by @aheritier in docker/docker-agent#4177
* feat(eval): pin injected docker-agent image to host CLI version by default by @aheritier in docker/docker-agent#4176
* docs: fix inaccuracies across SDK examples, CLI flags, telemetry, permissions, and integrations by @dgageot in docker/docker-agent#4184
* fix(http): bound the SSRF pre-check DNS lookup in desktopAwareTransport by @trungutt in docker/docker-agent#4186


**Full Changelog**: docker/docker-agent@v1.133.0...v1.134.0
</pre>
  <p>View the full release notes at <a href="https://github.com/docker/docker-agent/releases/tag/v1.134.0">https://github.com/docker/docker-agent/releases/tag/v1.134.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!18592
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants