Skip to content

fix(sdk): allow plain HTTP to every loopback address - #9

Merged
VikramLex merged 1 commit into
Graphicle-AI:mainfrom
rudycelekli:fix/loopback-http
Oct 24, 2026
Merged

VikramLex merged 1 commit into
Graphicle-AI:mainfrom
rudycelekli:fix/loopback-http

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Problem

Plain HTTP is allowed for loopback so the workspace capability is not sent across a network. The allow-list was only localhost, 127.0.0.1, and ::1. 127.0.0.2 and IPv4-mapped ::ffff:127.0.0.1 are loopback too, but both SDKs rejected them unless the caller marked the network as trusted. The Python client also skipped proxies only for those three names, so another 127/8 address could send the capability through a proxy. http://192.0.2.1, http://[::ffff:192.0.2.1], and http://example.com stay rejected.

Evidence

Before:

Client("http://127.0.0.2:1") -> ValueError: Plain http is only for loopback addresses
Client("http://[::ffff:127.0.0.1]:1") -> ValueError: Plain http is only for loopback addresses
node --test --test-name-pattern "plain http is limited"
not ok
error: 'Use HTTPS for remote services; insecureHttp is only for an explicitly trusted network'

After, those five loopback origins construct successfully, the non-loopback cases above still raise, and node --test test/client.test.js is 8 passed. The Python assertions are in test_the_capability_is_never_sent_over_plain_http_to_another_host and were run against graphicle_sdk.Client directly; that file's module skip still waits on GRAPHICLE_BIN in a checkout that has not built the service.

Made with Cursor

127.0.0.2 and IPv4-mapped loopback were refused, so a local service on any other 127/8 address required marking the network as trusted.

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
VikramLex added a commit that referenced this pull request Oct 24, 2026
…updates

SDKs: the Python and TypeScript SDKs allow plain http to every loopback
address, not only 127.0.0.1, [::1] and localhost (#9, by @rudycelekli,
the commit before this one). On top of it, the Python SDK reads an
IPv4-mapped address such as ::ffff:127.0.0.1 by its IPv4 address, because
the is_loopback of some Python releases (3.12.3, for one) is False for it.
New tests cover IPv4-mapped loopback under that older is_loopback, the
hosts that stay refused, and the URL parser's normal form, which the
TypeScript SDK judges: 127.1 and the octal and hex forms become 127.0.0.1,
and localhost. and 127.0.0.1.example.com are refused.

Security: tokio 1.53.3 (RUSTSEC-2026-0386) and ctutils 0.4.4
(RUSTSEC-2026-0385) in every lock that has them. Only their version and
checksum lines change, and the third-party licence pages are regenerated.
The comparison suite's reference pins take pypdf 6.21.2, which fixes the
pypdf advisories of the open Dependabot alerts.

Docs: docs/benchmarks.md has a section of independent measurements. Its
first entry is the kubernetes rerun by @selimaytac, who reported #8:
graphicle context took a median of 153.5 s per question on 0.1.3 and
9.5 s on 0.1.5 on an Apple M3 Pro, and the prompt hook returned a packet
for 18 of 22. The retrieval benchmark's page points to it.

Every crate is at 0.1.6, with a CHANGELOG entry.

Signed-off-by: VikramLex <vikramlex@karlexai.com>
@VikramLex
VikramLex merged commit ec71b35 into Graphicle-AI:main Oct 24, 2026
10 of 11 checks passed
@VikramLex

Copy link
Copy Markdown
Member

Thank you, @rudycelekli. This is merged as it is, and it ships in Graphicle 0.1.6.

We added one change on top. On some Python releases, ipaddress does not count ::ffff:127.0.0.1 as loopback (3.12.3, the default on Ubuntu 24.04, is one of them), so the Python client now unwraps an IPv4-mapped address before it checks. We also added a few tests for other URL forms.

The licences check that failed on this pull request came from two new Rust advisories (tokio and ctutils). The same release fixes them.

Release notes: https://github.com/Graphicle-AI/graphicle/releases/tag/v0.1.6

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.

2 participants