[PR #2564] [CLOSED] SECURITY.md: a page cors_origins lets in can have the server download image URLs, internal addresses too #4129

Closed
opened 2026-11-07 15:33:26 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2564
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: chief-docs/security-cors-images


📝 Commits (1)

  • d382e7f SECURITY.md: a page cors_origins lets in can have the server download image URLs, internal addresses too

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 SECURITY.md (+4 -1)

📄 Description

What it changes. One bullet of SECURITY.md's "What the server exposes" (CORS). With "cors_origins" listing a page (or ["*"]), that page's /v1 requests are accepted without a key when none is set (origin_allowed), and http(s) image URLs in them pass _no_local_images and are downloaded by the server (Vision.download, urllib, redirects followed) when it reads images. A failed download comes back as a 400 ("the image URL could not be read: ... Connection refused") with the CORS header, so the page can probe addresses on the user's network. The bullet now says so, says to list only pages you trust, and that files on the PC are still not read for such a page.

What it leaves alone. The server: this follows from the setting the user chose rather than from a gate the server misses, so it is documented, not changed. Without cors_origins a foreign page gets 403 before anything is fetched. Every other line of SECURITY.md.

How it was checked. A test against serve.server.serve(...) with a fake vision encoder, cors_origins: ["*"], an Origin: http://evil.example request with an image_url on 127.0.0.1: the internal listener received the GET, and a closed port's error came back with Access-Control-Allow-Origin: *. Each sentence was checked against _cors, _foreign_page, origin_allowed, _no_local_images and Vision.download by a sub-agent reviewer (its two wording fixes are in). Found in a security read of serve/server.py (#544's invitation).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2564 **Author:** [@qiuzan2001](https://github.com/qiuzan2001) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chief-docs/security-cors-images` --- ### 📝 Commits (1) - [`d382e7f`](https://github.com/Niko1221/Strata/commit/d382e7fbad95289db15ec3d3f0dcc1788d62db53) SECURITY.md: a page cors_origins lets in can have the server download image URLs, internal addresses too ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `SECURITY.md` (+4 -1) </details> ### 📄 Description **What it changes.** One bullet of SECURITY.md's "What the server exposes" (CORS). With `"cors_origins"` listing a page (or `["*"]`), that page's `/v1` requests are accepted without a key when none is set (`origin_allowed`), and `http(s)` image URLs in them pass `_no_local_images` and are downloaded by the server (`Vision.download`, `urllib`, redirects followed) when it reads images. A failed download comes back as a 400 ("the image URL could not be read: ... Connection refused") with the CORS header, so the page can probe addresses on the user's network. The bullet now says so, says to list only pages you trust, and that files on the PC are still not read for such a page. **What it leaves alone.** The server: this follows from the setting the user chose rather than from a gate the server misses, so it is documented, not changed. Without `cors_origins` a foreign page gets 403 before anything is fetched. Every other line of SECURITY.md. **How it was checked.** A test against `serve.server.serve(...)` with a fake vision encoder, `cors_origins: ["*"]`, an `Origin: http://evil.example` request with an `image_url` on `127.0.0.1`: the internal listener received the GET, and a closed port's error came back with `Access-Control-Allow-Origin: *`. Each sentence was checked against `_cors`, `_foreign_page`, `origin_allowed`, `_no_local_images` and `Vision.download` by a sub-agent reviewer (its two wording fixes are in). Found in a security read of `serve/server.py` (#544's invitation). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:33:26 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4129
No description provided.