Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(rembg): move to Pillow 13.0.0 on rembg 2.0.86 to close 41 image-decoder advisories on the caller-upload path

nirholas0a10f48c202a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31cd7dada..faff0f730 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-10-25
- **Allowance pulls now require the signed real-funds agreement**: Pulling funds through an owner-funded on-chain allowance now checks the signed real-funds agreements before the agent key is used, matching every other custodial signing path. Unsigned accounts get the standard agreement-required refusal and nothing is sent. `[fix]`
+- **Background-removal service moves to Pillow 13, closing 41 image-decoder advisories**: The background-removal worker decodes images that callers upload, and its pinned Pillow carried 41 open advisories including heap overflows in the JPEG, TIFF and FlashPix loaders. It now runs Pillow 13.0.0 on rembg 2.0.86 (the first release that allows it), matching every other worker, and the image build gate passes against the real models. `[fix]`
- **Commit feed cron skips quietly on a lock-check fault**: The commit feed cron now skips a tick with a 200 when the database lock check hits a transient fault, instead of answering a raw 500 and raising an ops alert. The next tick retries. `[fix]`
- **Fixed phone/desktop/CLI/Telegram account linking, which was failing on every attempt**: Every account-link action (mint, claim, poll, pending, decide, devices, revoke) behind /dashboard/account and the mobile-app pairing flow had been throwing on every call since the device-linking feature shipped on 2026-10-11, because its own first migration created a table under a name an older, unrelated agent-identity feature already owned, so the new table silently never got created with the right columns. The old table is renamed out of the way instead of dropped, so its rows are preserved, and the device-linking table now gets created with the shape the feature actually needs. (`/dashboard/account`) `[fix]`
- **Gallery and marketplace thumbnails degrade gracefully instead of showing a broken-image icon**: Six image spots on /gallery and /marketplace (the avatar grid thumbnail, the equip-avatar picker row, the live-sale ticker avatar, the animation marketplace listing card, the animation buy-modal preview, and a tool-detail icon) rendered a plain <img> with no fallback, so a 502 or missing thumbnail left the browser's default broken-image glyph on two of the highest-traffic pages in the product. All six now carry the same data-fallback attribute the site already uses elsewhere: card-style thumbnails swap to the existing placeholder box, small avatar icons just disappear instead. A seventh untagged image turned up in the gallery's forge-card renderer while verifying the other six and got the same fix. (`/gallery`) `[fix]`
diff --git a/data/changelog.json b/data/changelog.json
index b94d618db..0ac5e8340 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,14 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security, desktop (desktop entries become the desktop app's release notes). `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-10-25",
+ "title": "Background-removal service moves to Pillow 13, closing 41 image-decoder advisories",
+ "summary": "The background-removal worker decodes images that callers upload, and its pinned Pillow carried 41 open advisories including heap overflows in the JPEG, TIFF and FlashPix loaders. It now runs Pillow 13.0.0 on rembg 2.0.86 (the first release that allows it), matching every other worker, and the image build gate passes against the real models.",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-10-25",
"title": "Modly 3D-generation worker closes TLS, request-parsing and test-tooling advisories",
diff --git a/prompts/finish/449-auto-dependency-cve-pillow-rembg.md b/prompts/finish/449-auto-dependency-cve-pillow-rembg.md
deleted file mode 100644
index 442dc2a37..000000000
--- a/prompts/finish/449-auto-dependency-cve-pillow-rembg.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# 449. `workers/rembg` is still pinned to a Pillow with 41 open advisories, several of them RCE-class, on a caller-supplied image decode path
-
-How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now, no gate, no owner action required.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first. CLAUDE.md overrides everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan.
-- This is a bug fix (a security defect): follow the test-first rule (CLAUDE.md, "Bug fixes are test-first") as far as it applies. There is no app-level behavior bug to reproduce with a new test (this is a dependency-version fix), so the equivalent "prove it fails first" step is the OSV scan below: run it before the bump and confirm the advisories are present, then run it after and confirm they are gone.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates (spend/on-chain writes, push/deploy, posting externally, committing content referencing a crypto project other than `$THREE`, destroying unrecoverable data). This order touches none of them.
-- Concurrent agents share this worktree: stage explicit paths only (never `git add -A` or `git add .`), re-check `git status` and `git diff --staged` before committing.
-- The em-dash and en-dash characters are banned in everything you write.
-
-## Why this matters (measured 2026-10-25)
-
-`workers/rembg/requirements.txt` pins:
-
- Pillow==12.3.0
-
-with a comment claiming this is current and safe:
-
- # Pillow 12.3.0, not 11.x: every 11.x release carries open advisories, and this
- # service decodes an image the caller supplied, which is the exact path the heap
- # out-of-bounds writes in Image.paste/crop and the PSD and font loaders live on.
- # `npm run audit:deps` is what surfaces the next one.
-
-That comment is now stale. `npm run audit:deps` (the repo's OSV-based Python pin scanner, `scripts/check-deps.mjs`) run today against `workers/rembg/requirements.txt` reports 41 open advisories against `Pillow==12.3.0`, fixed by moving to `13.0.0`, including CRITICAL and HIGH RCE-class findings:
-
-- `GHSA-332p-7hrc-92wf`: heap buffer overflow in TIFF write, fixed in 13.0.0.
-- `GHSA-5x8w-8jj5-q52h`: FlashPix JPEG decode RCE, fixed in 13.0.0.
-- `GHSA-8g5g-8vmr-9782`: heap buffer overflow in JPEG decode, fixed in 13.0.0.
-- `GHSA-v9pv-5gc8-w2m6`: stale native-storage reuse (use-after-free class), fixed in 13.0.0.
-- `GHSA-w889-685w-c8fh`: Ghostscript argument injection leading to RCE via EPS handling, fixed in 13.0.0.
-- Plus ~36 further HIGH/MODERATE DoS and memory-safety findings, all listed as fixed in 13.0.0 by OSV.
-
-This is live exposure, not theoretical: `workers/rembg/main.py:153` (`_open_image`) runs `Image.open(io.BytesIO(data)).convert("RGBA")` on `data` that is the raw bytes of whatever the caller's `POST /remove` request supplied (`workers/rembg/README.md` confirms this is the service's primary mutating endpoint, gated only by `Authorization: Bearer $API_KEY`, which authenticates the caller but does not make the image bytes trustworthy). This is exactly the "hostile-input pass" class that `prompts/masters/06-the-adversary.md` calls out: a service that decodes attacker-chosen file bytes is the textbook reachable path for an image-library heap overflow, independent of whether the caller is also authenticated.
-
-This is not speculative or already covered elsewhere: every sibling GPU/CPU worker in this repo has already made this exact bump and rembg is the one holdout. Confirmed today:
-
- grep -rn "^Pillow==" workers/*/requirements*.txt
-
-returns `Pillow==13.0.0` in `workers/remesh/requirements.txt`, `workers/texture/requirements.txt`, `workers/modly/requirements-triposg.txt`, `workers/modly/requirements-hunyuan.txt`, and `workers/modly/requirements-host.txt`, and `Pillow==12.3.0` only in `workers/rembg/requirements.txt`. There is no base-image or transitive-dependency constraint holding rembg back: rembg's own Dockerfile (`FROM python:3.11-slim`) matches the Python version the other already-bumped workers use, and `rembg==2.0.75`'s own dependency floor does not pin Pillow upward.
-
-This is also not a duplicate of order 444 (which fixed `fast-xml-parser` under `@bnb-chain/greenfield-js-sdk`, a JS/npm dependency, unrelated package and unrelated worker) or of the `transformers`/`diffusers` pins in `workers/model-triposg`, `workers/texture`, `workers/model-hunyuan3d`, `workers/modly`, and `workers/longcat` (those pins carry their own in-file comments explaining they are deliberately held back by a torch/base-image compatibility constraint; Pillow in rembg has no such constraint and no such comment, it is a plain oversight).
-
-## Task
-
-1. Read `workers/rembg/requirements.txt` in full and confirm the current state described above (`Pillow==12.3.0`, stale comment).
-2. Read `workers/rembg/main.py` lines 1-200, specifically `_open_image` (around line 145) and `_decode_image` (around line 162), to confirm the caller-supplied decode path the comment already describes is still accurate after the bump (no code change expected here, this is a version-only fix).
-3. Before changing anything, run the scanner and capture the "before" state:
-
- npm run audit:deps 2>&1 | tee /tmp/audit-deps-before.log
- grep -A3 "rembg/requirements.txt" /tmp/audit-deps-before.log | grep -i pillow
-
- Confirm it reports `Pillow==12.3.0` with open advisories (expect the CRITICAL/HIGH GHSA IDs listed above among them; the exact count may drift slightly if OSV has added or reclassified entries since this order was written, that does not change the fix).
-4. Edit `workers/rembg/requirements.txt`: change `Pillow==12.3.0` to `Pillow==13.0.0`, and update the comment above it to state the new version and that this pin is now aligned with every other worker in the repo (remove the now-false "Pillow 12.3.0, not 11.x" framing; state what 13.0.0 fixes instead, matching the style used in `workers/modly/requirements-host.txt`'s `Pillow==13.0.0` line or lack of comment there, whichever reads cleaner given this file already has a paragraph in place).
-5. Re-run the scanner and capture the "after" state:
-
- npm run audit:deps 2>&1 | tee /tmp/audit-deps-after.log
- grep -A3 "rembg/requirements.txt" /tmp/audit-deps-after.log | grep -i pillow
-
- Confirm the Pillow advisories against `workers/rembg/requirements.txt` are gone (either the package line is absent from the report, or any remaining entries are for a different package in that file, not Pillow).
-6. Build the worker image to exercise the real decode path end to end; the Dockerfile's own build gate (`workers/rembg/Dockerfile`, final `RUN` before `EXPOSE`) runs `test_rembg_policy.py` and `test_rembg_smoke.py` (with `API_KEY=build-gate GCS_BUCKET=build-gate`) inside the image build itself, so a successful build is the real verification that Pillow 13.0.0 still decodes and processes images correctly with the baked `u2net` and `isnet-general-use` models:
-
- cd workers/rembg && docker build -t rembg-pillow-bump-test . 2>&1 | tail -60
-
- This must complete successfully (the `RUN python test_rembg_policy.py && API_KEY=build-gate GCS_BUCKET=build-gate python test_rembg_smoke.py` layer is the gate; if it fails, read the output, it will say which assertion failed, and fix forward, do not skip or weaken the gate). Remove the test image afterward (`docker rmi rembg-pillow-bump-test`) so this does not leave build artifacts behind; this is a local verification build, not a deploy, and must never be pushed to any registry.
-7. Run `npm run check:rules -- --paths workers/rembg/requirements.txt` and fix anything it flags.
-8. Add a `data/changelog.json` entry (tag `fix`) noting the rembg background-removal service closed a batch of image-library security advisories, matching the style and surface link used for prior dependency-fix entries (check how order 444's changelog entry referenced `fast-xml-parser`/greenfield for the wording convention), then run `npm run build:pages` and confirm only the expected generated files change.
-9. Read the full diff (`git diff workers/rembg/requirements.txt data/changelog.json`) and confirm every changed line is one of the changes above (requirements.txt: version + comment; changelog: one new entry; generated files from `build:pages`).
-
-## Done when
-
-- `workers/rembg/requirements.txt` pins `Pillow==13.0.0`, with its comment accurate and no longer naming 12.3.0 as current.
-- `npm run audit:deps` no longer reports Pillow advisories against `workers/rembg/requirements.txt` (captured before/after logs prove this).
-- `docker build` of `workers/rembg` completes successfully, meaning the image's own build-gate tests (`test_rembg_policy.py`, `test_rembg_smoke.py`) pass against the new Pillow version with the real baked ONNX models.
-- The verification test image is removed (`docker rmi`), no build artifacts left behind.
-- `npm run check:rules -- --paths workers/rembg/requirements.txt` reports no violations.
-- A changelog entry exists and `npm run build:pages` ran cleanly.
-- Nothing outside `workers/rembg/requirements.txt`, `data/changelog.json`, and the generated `public/changelog*`/`CHANGELOG.md` files changed.
-
-## Never blocked
-
-| Apparent blocker | Resolution |
-| --- | --- |
-| "Docker build takes a while and downloads base images." | It is a one-layer-cached `python:3.11-slim` pull plus a pip install; run it, it completes within this session. If Docker is genuinely unavailable in a future environment, fall back to installing `Pillow==13.0.0` into a local venv alongside rembg's other pins and running `test_rembg_policy.py`/`test_rembg_smoke.py` directly, but Docker is confirmed available here (`docker ps` succeeds), so use the real build gate. |
-| "The OSV advisory count might differ from the 41 cited here." | The exact count drifts as OSV adds entries; what matters is that Pillow 13.0.0 is the latest stable release and the fix-version every currently-known advisory against 12.3.0 points to. Bump to 13.0.0, not to some intermediate version, and move on. |
-| "Should this also touch `transformers` or `diffusers` pins while in this area?" | No. Those pins carry their own deliberate, already-reasoned comments explaining a torch/base-image blocker; touching them is a separate, larger decision this order does not cover. |
-| "rembg's own `[gpu]` extra or ONNX pin might need to move too." | No. This order is scoped to Pillow only; `onnxruntime==1.28.0` and `rembg==2.0.75` are unaffected by this advisory set and are not being re-evaluated here. |
-
-## Report format
-
-State: the old and new Pillow version, the before/after `audit:deps` advisory counts for this file, the Docker build result (pass/fail and the two build-gate test names it ran), the `check:rules` result, and the commit hash.
diff --git a/public/changelog-recent.json b/public/changelog-recent.json
index 940296abe..7e0ad9522 100644
--- a/public/changelog-recent.json
+++ b/public/changelog-recent.json
@@ -1,11 +1,11 @@
{
- "generated_at": "2026-10-25T11:58:51.013Z",
+ "generated_at": "2026-10-25T12:00:43.566Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
"url": "https://three.ws"
},
- "total": 4203,
+ "total": 4204,
"complete": false,
"full_feed": "/changelog.json",
"entries": [
@@ -19,6 +19,16 @@
"fix"
]
},
+ {
+ "date": "2026-10-25",
+ "type": "update",
+ "title": "Background-removal service moves to Pillow 13, closing 41 image-decoder advisories",
+ "summary": "The background-removal worker decodes images that callers upload, and its pinned Pillow carried 41 open advisories including heap overflows in the JPEG, TIFF and FlashPix loaders. It now runs Pillow 13.0.0 on rembg 2.0.86 (the first release that allows it), matching every other worker, and the image build gate passes against the real models.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-10-25",
"type": "update",
@@ -1546,17 +1556,6 @@
"feature",
"docs"
]
- },
- {
- "date": "2026-10-13",
- "type": "update",
- "title": "Open source credits: every dependency, model, and asset source three.ws runs on, in one place",
- "summary": "A new /open-source page lists every third-party dependency, GPU worker model, and free asset source the platform runs on, grouped by area (rendering, formats and compression, generation models, motion, voice, assets, infrastructure) with license, upstream link, and what each one powers here. The dataset is generated from package.json and each worker's own README, not hand-maintained, and a guard test fails the build if a new direct dependency lands without a credited entry. Credits now also show up where the work actually happens: /objects and the object viewer name Poly Haven, the CC0 asset library the catalog sources from; the Forge export dialog names meshoptimizer and glTF-Transform; and the animation gallery shows each clip's source and license, including a fallback for studio-tier clips that lack an explicit manifest entry. Docs: /docs/open-source-credits.",
- "link": "/open-source",
- "tags": [
- "feature",
- "docs"
- ]
}
]
}
diff --git a/public/changelog.json b/public/changelog.json
index f72441876..dcc97c17f 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-10-25T11:58:50.978Z",
+ "generated_at": "2026-10-25T12:00:43.532Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -16,6 +16,16 @@
"fix"
]
},
+ {
+ "date": "2026-10-25",
+ "type": "update",
+ "title": "Background-removal service moves to Pillow 13, closing 41 image-decoder advisories",
+ "summary": "The background-removal worker decodes images that callers upload, and its pinned Pillow carried 41 open advisories including heap overflows in the JPEG, TIFF and FlashPix loaders. It now runs Pillow 13.0.0 on rembg 2.0.86 (the first release that allows it), matching every other worker, and the image build gate passes against the real models.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-10-25",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index a383b16de..a50842e32 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -14,6 +14,14 @@
<category>fix</category>
<description>Pulling funds through an owner-funded on-chain allowance now checks the signed real-funds agreements before the agent key is used, matching every other custodial signing path. Unsigned accounts get the standard agreement-required refusal and nothing is sent.</description>
</item>
+ <item>
+ <title>Background-removal service moves to Pillow 13, closing 41 image-decoder advisories</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-10-25:Background-removal service moves to Pillow 13, closing 41 image-decoder advisories</guid>
+ <pubDate>Sun, 25 Oct 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The background-removal worker decodes images that callers upload, and its pinned Pillow carried 41 open advisories including heap overflows in the JPEG, TIFF and FlashPix loaders. It now runs Pillow 13.0.0 on rembg 2.0.86 (the first release that allows it), matching every other worker, and the image build gate passes against the real models.</description>
+ </item>
<item>
<title>Commit feed cron skips quietly on a lock-check fault</title>
<link>https://three.ws/changelog</link>