Skip to content

Code graph and memory for your coding agents, in one Rust program. For Claude Code, Codex, Cursor and any MCP client.

Graphicle 0.1.6: loopback HTTP in the SDKs (#9), dependency security updates

VikramLexddfd775d83fc
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 82b25e4..81ed52d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,42 @@
Notable changes to Graphicle: the graph engine (`graphicle-graph`), the memory
library (`graphicle-memory`) and the `graphicle` program.
+## 0.1.6 - 2026-10-24
+
+Every crate is at 0.1.6, and `graphicle --version` prints
+`graphicle 0.1.6 (core)`.
+
+### SDKs
+
+- The Python and TypeScript SDKs allow plain `http://` to every loopback
+ address: the rest of 127.0.0.0/8, such as `127.0.0.2`, and IPv4-mapped
+ loopback, such as `[::ffff:127.0.0.1]`, as well as `127.0.0.1`, `[::1]`
+ and `localhost`. Before, a local service on another loopback address
+ needed `insecure_http=True` (Python) or `insecureHttp: true`
+ (TypeScript) (#9, by @rudycelekli). The Python SDK reads an IPv4-mapped
+ address by its IPv4 address on every Python version, and its requests
+ to all of these addresses ignore proxy settings, as they did for
+ `127.0.0.1`.
+
+### Security
+
+- tokio 1.53.3 and ctutils 0.4.4, for RUSTSEC-2026-0386 (the safe
+ constructors of tokio's `AsyncFd` break I/O safety; Graphicle does not
+ call them) and RUSTSEC-2026-0385 (ctutils made masks and `u128`
+ comparisons that were not constant-time). Only the lock files and the
+ third-party licence pages change.
+- The Python environment of the engine's comparison suite pins pypdf
+ 6.21.2, which fixes security advisories.
+
+### Documentation
+
+- `docs/benchmarks.md` has a section of
+ [independent measurements](https://github.com/Graphicle-AI/graphicle/blob/v0.1.6/docs/benchmarks.md#independent-measurements).
+ Its first entry is the rerun by @selimaytac, who reported #8, of their
+ 22 questions about kubernetes on an Apple M3 Pro, with no answer model:
+ `graphicle context` took a median of 153.5 s per question on 0.1.3 and
+ 9.5 s on 0.1.5, and the prompt hook returned a packet for 18 of 22.
+
## 0.1.5 - 2026-10-22
Every crate is at 0.1.5, and `graphicle --version` prints
diff --git a/crates/graphicle-graph/Cargo.lock b/crates/graphicle-graph/Cargo.lock
index d958bd7..7abb06a 100644
--- a/crates/graphicle-graph/Cargo.lock
+++ b/crates/graphicle-graph/Cargo.lock
@@ -1016,9 +1016,9 @@ dependencies = [
[[package]]
name = "ctutils"
-version = "0.4.2"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e"
+checksum = "12218662ccac37d9714f2191252553d67585b97df8c839cbe49e0bde278dc865"
dependencies = [
"cmov",
]
@@ -1471,7 +1471,7 @@ checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
[[package]]
name = "graphicle"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"aws-config",
"aws-sdk-bedrockruntime",
@@ -1571,7 +1571,7 @@ dependencies = [
[[package]]
name = "graphicle-graph"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"graphicle",
"libmimalloc-sys",
@@ -4390,9 +4390,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"
[[package]]
name = "tokio"
-version = "1.53.1"
+version = "1.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
+checksum = "ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e"
dependencies = [
"bytes",
"libc",
diff --git a/crates/graphicle-graph/Cargo.toml b/crates/graphicle-graph/Cargo.toml
index 590e74e..792f1d1 100644
--- a/crates/graphicle-graph/Cargo.toml
+++ b/crates/graphicle-graph/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "graphicle"
-version = "0.1.5"
+version = "0.1.6"
edition = "2024"
rust-version = "1.94.1"
publish = false
diff --git a/crates/graphicle-graph/cli/Cargo.toml b/crates/graphicle-graph/cli/Cargo.toml
index 97da113..621d61c 100644
--- a/crates/graphicle-graph/cli/Cargo.toml
+++ b/crates/graphicle-graph/cli/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "graphicle-graph"
-version = "0.1.5"
+version = "0.1.6"
edition = "2024"
rust-version = "1.94.1"
publish = false
diff --git a/crates/graphicle-graph/licenses/THIRD_PARTY_LICENSES.html b/crates/graphicle-graph/licenses/THIRD_PARTY_LICENSES.html
index 0520785..3785274 100644
--- a/crates/graphicle-graph/licenses/THIRD_PARTY_LICENSES.html
+++ b/crates/graphicle-graph/licenses/THIRD_PARTY_LICENSES.html
@@ -644,7 +644,7 @@
<ul><li><a href="https://github.com/KyleMayes/clang-sys">clang-sys 1.9.1</a></li>
<li><a href="https://github.com/RustCrypto/utils">cmov 0.5.4</a></li>
<li><a href="https://github.com/hsivonen/codepage">codepage 0.1.3</a></li>
-<li><a href="https://github.com/RustCrypto/utils">ctutils 0.4.2</a></li>
+<li><a href="https://github.com/RustCrypto/utils">ctutils 0.4.4</a></li>
<li><a href="https://github.com/hsivonen/encoding_rs">encoding_rs 0.8.41</a></li>
<li><a href="https://github.com/Licenser/halfbrown">halfbrown 0.4.0</a></li>
<li><a href="https://github.com/SOF3/include-flate.git">include-flate 0.3.4</a></li>
@@ -13088,7 +13088,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
<h3 id="MIT">MIT License</h3>
<p>Used by:</p>
<ul><li><a href="https://github.com/tokio-rs/tokio">tokio-util 0.7.19</a></li>
-<li><a href="https://github.com/tokio-rs/tokio">tokio 1.53.1</a></li>
+<li><a href="https://github.com/tokio-rs/tokio">tokio 1.53.3</a></li>
</ul>
<pre>MIT License
diff --git a/crates/graphicle-graph/tools/reference-requirements.txt b/crates/graphicle-graph/tools/reference-requirements.txt
index f7800ff..dd6a97d 100644
--- a/crates/graphicle-graph/tools/reference-requirements.txt
+++ b/crates/graphicle-graph/tools/reference-requirements.txt
@@ -18,6 +18,7 @@
# uv pip install --python .reference-venv/bin/python -r tools/reference-requirements.txt
# then write the .pth file naming the comparison venv's site-packages.
# pillow is 13.0.0 (security advisories) instead of the recorded 12.3.0.
+# pypdf is 6.21.2 (security advisories) instead of the recorded 6.19.0.
annotated-types==0.8.0
anthropic==1.8.0
anyio==4.15.1
@@ -45,7 +46,7 @@ psycopg==3.3.6
psycopg-binary==3.3.6
pydantic==2.13.5
pydantic_core==2.46.5
-pypdf==6.19.0
+pypdf==6.21.2
python-dateutil==2.9.0.post0
python-docx==1.2.0
pytz==2026.3.post1
diff --git a/crates/graphicle-memory/Cargo.lock b/crates/graphicle-memory/Cargo.lock
index 38434d1..c2f218b 100644
--- a/crates/graphicle-memory/Cargo.lock
+++ b/crates/graphicle-memory/Cargo.lock
@@ -1008,9 +1008,9 @@ dependencies = [
[[package]]
name = "ctutils"
-version = "0.4.2"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e"
+checksum = "12218662ccac37d9714f2191252553d67585b97df8c839cbe49e0bde278dc865"
dependencies = [
"cmov",
]
@@ -1453,7 +1453,7 @@ checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
[[package]]
name = "graphicle"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"aws-config",
"aws-sdk-bedrockruntime",
@@ -1551,7 +1551,7 @@ dependencies = [
[[package]]
name = "graphicle-memory"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"chrono",
"graphicle",
@@ -4443,9 +4443,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"
[[package]]
name = "tokio"
-version = "1.53.1"
+version = "1.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
+checksum = "ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e"
dependencies = [
"bytes",
"libc",
diff --git a/crates/graphicle-memory/Cargo.toml b/crates/graphicle-memory/Cargo.toml
index 7904820..3d17c14 100644
--- a/crates/graphicle-memory/Cargo.toml
+++ b/crates/graphicle-memory/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "graphicle-memory"
-version = "0.1.5"
+version = "0.1.6"
edition = "2024"
rust-version = "1.94.1"
publish = false
diff --git a/crates/graphicle/Cargo.lock b/crates/graphicle/Cargo.lock
index 6dc51b8..57e1098 100644
--- a/crates/graphicle/Cargo.lock
+++ b/crates/graphicle/Cargo.lock
@@ -1327,7 +1327,7 @@ dependencies = [
[[package]]
name = "graphicle"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"base64 0.22.1",
"calamine",
@@ -1421,7 +1421,7 @@ dependencies = [
[[package]]
name = "graphicle-memory"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"chrono",
"graphicle",
@@ -1439,7 +1439,7 @@ dependencies = [
[[package]]
name = "graphicle-runtime"
-version = "0.1.5"
+version = "0.1.6"
dependencies = [
"aes-gcm",
"axum",
@@ -4647,9 +4647,9 @@ dependencies = [
[[package]]
name = "tokio"
-version = "1.53.1"
+version = "1.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
+checksum = "ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e"
dependencies = [
"bytes",
"libc",
diff --git a/crates/graphicle/Cargo.toml b/crates/graphicle/Cargo.toml
index 68dca08..37248f6 100644
--- a/crates/graphicle/Cargo.toml
+++ b/crates/graphicle/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "graphicle-runtime"
-version = "0.1.5"
+version = "0.1.6"
edition = "2024"
rust-version = "1.94.1"
publish = false
diff --git a/crates/graphicle/README.md b/crates/graphicle/README.md
index e6dd941..2d562cf 100644
--- a/crates/graphicle/README.md
+++ b/crates/graphicle/README.md
@@ -55,7 +55,7 @@ operations through the extension registry (`src/extension.rs`).
provider permission mode ("is not part of Graphicle Core"), while it still enforces
the provider permissions an existing store holds.
- `build.info` reports the edition and its capabilities, and
- `graphicle --version` prints it (`graphicle 0.1.5 (core)`).
+ `graphicle --version` prints it (`graphicle 0.1.6 (core)`).
- A store keeps every table when either edition opens it, and Core keeps the
other edition's guarantees on a store it has used (`src/store_compat.rs`).
diff --git a/crates/graphicle/THIRD_PARTY_LICENSES.html b/crates/graphicle/THIRD_PARTY_LICENSES.html
index 7010d01..b85d50f 100644
--- a/crates/graphicle/THIRD_PARTY_LICENSES.html
+++ b/crates/graphicle/THIRD_PARTY_LICENSES.html
@@ -13295,7 +13295,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
<h3 id="MIT">MIT License</h3>
<p>Used by:</p>
<ul><li><a href="https://github.com/tokio-rs/tokio">tokio-util 0.7.19</a></li>
-<li><a href="https://github.com/tokio-rs/tokio">tokio 1.53.1</a></li>
+<li><a href="https://github.com/tokio-rs/tokio">tokio 1.53.3</a></li>
</ul>
<pre>MIT License
diff --git a/crates/graphicle/tests/test_sdk_origins.py b/crates/graphicle/tests/test_sdk_origins.py
index d0ba0c0..587e9f0 100644
--- a/crates/graphicle/tests/test_sdk_origins.py
+++ b/crates/graphicle/tests/test_sdk_origins.py
@@ -1,5 +1,7 @@
"""Authenticated SDK requests stay on their configured service origin."""
+import ipaddress
import sys
+import urllib.request
from pathlib import Path
from unittest.mock import Mock
@@ -24,6 +26,32 @@ def test_client_requires_a_service_origin(url):
Client(url, "workspace", "test-capability")
[email protected]("host", ["::ffff:127.0.0.1", "::ffff:7f00:2", "::ffff:127.255.255.254"])
+def test_ipv4_mapped_loopback_is_loopback_on_every_python(host, monkeypatch):
+ # Give IPv6Address the is_loopback of the Python releases that answer False for
+ # IPv4-mapped addresses (3.12.3, for one), so the client's own reading is what is tested.
+ monkeypatch.setattr(ipaddress.IPv6Address, "is_loopback", property(lambda address: int(address) == 1))
+ assert not ipaddress.ip_address(host).is_loopback
+ monkeypatch.setenv("http_proxy", "http://proxy.invalid:3128")
+
+ def http_proxies(client):
+ return [handler.proxies.get("http") for handler in client._opener.handlers
+ if isinstance(handler, urllib.request.ProxyHandler)]
+
+ # Plain http is allowed, and, as for every loopback address, the proxy settings are not
+ # used; a host on the network (allowed with insecure_http) goes through the proxy.
+ assert http_proxies(Client(f"http://[{host}]:8854", "workspace", "test-capability")) == []
+ remote = Client("http://[::ffff:10.0.0.5]:8854", "workspace", "test-capability", insecure_http=True)
+ assert http_proxies(remote) == ["http://proxy.invalid:3128"]
+
+
[email protected]("host", ["[::ffff:10.0.0.5]", "[::127.0.0.1]", "localhost.", "127.0.0.1.example.com", "127.1"])
+def test_plain_http_refuses_hosts_that_are_not_read_as_loopback(host):
+ # [::127.0.0.1] is IPv4-compatible, not IPv4-mapped; 127.1 is no address to ipaddress.
+ with pytest.raises(ValueError, match="loopback"):
+ Client(f"http://{host}:8854", "workspace", "test-capability")
+
+
def test_origin_path_keeps_query_and_workspace_capability():
client = Client("https://service.invalid/", "workspace", "test-capability")
response = Mock()
diff --git a/docs/benchmarks.md b/docs/benchmarks.md
index 95173f2..a6b41e6 100644
--- a/docs/benchmarks.md
+++ b/docs/benchmarks.md
@@ -14,6 +14,7 @@ endorsement is implied.
| Code-graph engine: peak memory | A pre-release build with 0.1.1's changes to how the engine holds its data, against Graphify 0.9.91, 15 October 2026; five measurements rechecked on a build of the merged 0.1.1 source | Less peak memory than Graphify 0.9.91 in all 39 measurements (13 repositories; extract, priming update and update with no change), from 0.29 to 0.97 times Graphify's figure; Kubernetes extract 2,091.5 against 2,767 MiB. One Linux node (its 8 H100 GPUs not used), 8 workers; Graphicle's peak RSS against Graphify's peak PSS. [Details](#peak-memory-against-graphify-0991) |
| Coding agents: Claude Code with Graphicle, Graphify or neither | Four task sets, each test registered before any answer was scored; Claude Code with Opus 5.5, and one set repeated with Haiku 5.5 | Graphicle tied plain Claude Code on finding files and facts in every test, and no token saving is claimed against it. Against Graphify 0.9.91, Graphicle found more facts on Graphify's showcase corpus and used fewer tokens in all four task sets (on SWE-bench Verified, a secondary comparison); in two of them, Graphicle's arm included a prototype that does not ship. [Details](#coding-agents-with-graphicle-graphify-or-neither) |
| Retrieval: finding the files a fix changes | Graphicle 0.1.3 and the 0.1.2 release, offline, 21 October 2026, on 100 SWE-bench Verified issues never used for tuning and 80 issues used for tuning | On the held-out issues, a file the fix changed was among the first 5 files of 0.1.3's context packet for 75, against 61 for BM25 (SWE-bench style; McNemar exact p = 0.013) and 54 for grep on the issue's names; for the first file and the first 10 files the differences from BM25 are not significant. Ranking only: the agent test of 0.1.3 is pending ([retrieval benchmark](benchmarks/retrieval.md)) |
+| Retrieval: time per question, measured independently | Run and published by @selimaytac, who reported issue #8, on Graphicle 0.1.3 and 0.1.5, 23 October 2026 | kubernetes, 22 questions, an Apple M3 Pro, no answer model: `graphicle context` took a median of 153.5 s per question on 0.1.3 and 9.5 s on 0.1.5, and the prompt hook returned a packet for 18 of 22. [Details](#independent-measurements) |
| Agent memory: comparison with seven memory systems | Done, on development sets, with a proxy evaluator | Every system's scores and the 21 registered comparisons are [below](#agent-memory-comparison-with-seven-memory-systems). None of them is a headline claim |
| Agent memory: retrieval defaults | Chosen | Model-free retrieval runs on development data, plus held-out checks; their records are not published yet, so no numbers are given |
@@ -1133,6 +1134,45 @@ numbers.
raised evidence recall in the held-out check. It is kept, but off until its
effect on answers is measured.
+## Independent measurements
+
+People outside the project who measured Graphicle with their own scripts,
+on their own machines, and published the results. The numbers below are
+theirs.
+
+### `graphicle context` on kubernetes, 0.1.3 and 0.1.5
+
+[@selimaytac](https://github.com/selimaytac), who reported
+[issue #8](https://github.com/Graphicle-AI/graphicle/issues/8), ran their 22
+questions about kubernetes on Graphicle 0.1.3 and again on 0.1.5, and
+published the script, the questions and the rows of both runs:
+[selimaytac/benchmarks, graphicle-context](https://github.com/selimaytac/benchmarks/tree/main/graphicle-context).
+Thank you for the report, the questions and the rerun.
+
+**Label:** kubernetes at `ca8a2a9e4`, a shallow clone with the history since
+1 June 2026; the 22 questions of issue #8; an Apple M3 Pro; no answer model
+configured, so no model calls; published 23 October 2026.
+
+| | 0.1.3 | 0.1.5 |
+|---|---|---|
+| `graphicle context`, median time per question | 153.5 s | 9.5 s |
+| The prompt hook returned a packet (one pass) | not run | 18 of 22 |
+
+- **A fixed cost per call.** On that machine each call of 0.1.5 takes
+ about 9 seconds whatever the question, just under the prompt hook's
+ default budget of 10 seconds. `GRAPHICLE_PROMPT_CONTEXT_SECONDS`, or
+ `graphicle config set prompt_context.seconds N` (1 to 25 seconds), raises
+ the budget.
+- **The hook's 4 misses.** 2 of the 22 questions name no code, and the hook
+ does not read them as code questions; the other 2 ran past the budget in
+ that pass.
+- **Rough ratio.** The 0.1.3 column is one round per question, measured
+ while the machine had other work for part of the run; the 0.1.5 column
+ is three rounds per question.
+- **Our own run.** On 16 cores of a Linux server, the same 22 questions took
+ a median of 3.1 seconds with 0.1.5 (the 0.1.5 entry of the
+ [CHANGELOG](../CHANGELOG.md)).
+
## Reproducing
The memory benchmark kit is in `bench/memory`. It runs the real `graphicle`
diff --git a/docs/benchmarks/retrieval.md b/docs/benchmarks/retrieval.md
index 2383388..1438f11 100644
--- a/docs/benchmarks/retrieval.md
+++ b/docs/benchmarks/retrieval.md
@@ -24,6 +24,11 @@ a fix changes
The two baselines below are fixed procedures, defined exactly; they are not
what an agent does when it searches with grep or a search engine.
+It does not measure how long a question takes. For the time of
+`graphicle context` per question on kubernetes, measured independently by
+the reporter of issue #8, see
+[Independent measurements](../benchmarks.md#independent-measurements).
+
## Results
### Held-out set: 100 SWE-bench Verified issues, never used for tuning
diff --git a/docs/install.md b/docs/install.md
index 404e75a..27d7d0e 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -16,7 +16,7 @@ step.
```sh
brew install graphicle-ai/tap/graphicle
-graphicle --version # graphicle 0.1.5 (core)
+graphicle --version # graphicle 0.1.6 (core)
```
`brew upgrade graphicle` installs a new release. Afterwards, read
@@ -154,7 +154,7 @@ folder with both programs, `LICENSE`, `NOTICE`, `NOTICE.md`, `README.md`,
| Windows, x86-64 (preview) | `x86_64-pc-windows-msvc`, a `.zip` |
```sh
-version=0.1.5
+version=0.1.6
target=aarch64-apple-darwin
base=https://github.com/graphicle-ai/graphicle/releases/download/v$version
curl -fLO "$base/graphicle-$version-$target.tar.gz"
@@ -248,7 +248,7 @@ in them.
## Check the installation
```sh
-graphicle --version # graphicle 0.1.5 (core)
+graphicle --version # graphicle 0.1.6 (core)
graphicle graph --help # the code-graph engine's commands
graphicle doctor # checks the programs, the data folder and your agents
```
diff --git a/licenses/graphicle-graph/licenses/THIRD_PARTY_LICENSES.html b/licenses/graphicle-graph/licenses/THIRD_PARTY_LICENSES.html
index 0520785..3785274 100644
--- a/licenses/graphicle-graph/licenses/THIRD_PARTY_LICENSES.html
+++ b/licenses/graphicle-graph/licenses/THIRD_PARTY_LICENSES.html
@@ -644,7 +644,7 @@
<ul><li><a href="https://github.com/KyleMayes/clang-sys">clang-sys 1.9.1</a></li>
<li><a href="https://github.com/RustCrypto/utils">cmov 0.5.4</a></li>
<li><a href="https://github.com/hsivonen/codepage">codepage 0.1.3</a></li>
-<li><a href="https://github.com/RustCrypto/utils">ctutils 0.4.2</a></li>
+<li><a href="https://github.com/RustCrypto/utils">ctutils 0.4.4</a></li>
<li><a href="https://github.com/hsivonen/encoding_rs">encoding_rs 0.8.41</a></li>
<li><a href="https://github.com/Licenser/halfbrown">halfbrown 0.4.0</a></li>
<li><a href="https://github.com/SOF3/include-flate.git">include-flate 0.3.4</a></li>
@@ -13088,7 +13088,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
<h3 id="MIT">MIT License</h3>
<p>Used by:</p>
<ul><li><a href="https://github.com/tokio-rs/tokio">tokio-util 0.7.19</a></li>
-<li><a href="https://github.com/tokio-rs/tokio">tokio 1.53.1</a></li>
+<li><a href="https://github.com/tokio-rs/tokio">tokio 1.53.3</a></li>
</ul>
<pre>MIT License
diff --git a/licenses/graphicle/THIRD_PARTY_LICENSES.html b/licenses/graphicle/THIRD_PARTY_LICENSES.html
index 7010d01..b85d50f 100644
--- a/licenses/graphicle/THIRD_PARTY_LICENSES.html
+++ b/licenses/graphicle/THIRD_PARTY_LICENSES.html
@@ -13295,7 +13295,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
<h3 id="MIT">MIT License</h3>
<p>Used by:</p>
<ul><li><a href="https://github.com/tokio-rs/tokio">tokio-util 0.7.19</a></li>
-<li><a href="https://github.com/tokio-rs/tokio">tokio 1.53.1</a></li>
+<li><a href="https://github.com/tokio-rs/tokio">tokio 1.53.3</a></li>
</ul>
<pre>MIT License
diff --git a/sdk/python/graphicle_sdk/client.py b/sdk/python/graphicle_sdk/client.py
index 0e6cc1d..e85634c 100644
--- a/sdk/python/graphicle_sdk/client.py
+++ b/sdk/python/graphicle_sdk/client.py
@@ -85,6 +85,7 @@ __all__ = [
#: Job states that are still in progress.
PENDING_STATES = frozenset({"queued", "retry", "running"})
+
def _is_loopback(hostname: str) -> bool:
"""True for localhost and every loopback address, not only three spellings.
@@ -95,9 +96,15 @@ def _is_loopback(hostname: str) -> bool:
if hostname.lower() == "localhost":
return True
try:
- return ipaddress.ip_address(hostname).is_loopback
+ address = ipaddress.ip_address(hostname)
except ValueError:
return False
+ # An IPv4-mapped address is judged by its IPv4 address: the is_loopback of some
+ # Python releases (3.12.3, for one) is False for ::ffff:127.0.0.1.
+ mapped = getattr(address, "ipv4_mapped", None)
+ if mapped is not None:
+ address = mapped
+ return address.is_loopback
# Service limits: connector.import takes at most 5,000 documents per call and a request body is
diff --git a/sdk/typescript/test/client.test.js b/sdk/typescript/test/client.test.js
index b2d3643..85f3cd9 100644
--- a/sdk/typescript/test/client.test.js
+++ b/sdk/typescript/test/client.test.js
@@ -71,6 +71,16 @@ test("plain http is limited to loopback, including the rest of 127/8 and IPv4-ma
assert.throws(() => client("http://192.0.2.1:8854"), /HTTPS|loopback|trusted/i);
});
+test("plain http judges the host in the URL parser's normal form, which requests use", () => {
+ for (const [url, origin] of [["http://127.1:8854", "http://127.0.0.1:8854"], ["http://0x7f.0.0.1:8854", "http://127.0.0.1:8854"],
+ ["http://0177.0.0.1:8854", "http://127.0.0.1:8854"], ["http://2130706433:8854", "http://127.0.0.1:8854"]]) {
+ assert.equal(client(url).url, origin);
+ }
+ for (const url of ["http://localhost.:8854", "http://127.0.0.1.example.com:8854", "http://[::ffff:10.0.0.1]:8854", "http://[::127.0.0.1]:8854", "http://0.0.0.0:8854"]) {
+ assert.throws(() => client(url), /HTTPS/);
+ }
+});
+
test("credentials and project authority cannot be redirected by arguments", async () => {
for (const url of ["https://user:[email protected]", "https://example.com/path", "https://example.com?x=1", "http://example.com", "https://example.com/#x"]) assert.throws(() => client(url));
const c = client("https://example.com");