[PR #1126] [CLOSED] Harden server, installer and engine against high-risk bugs #3045

Closed
opened 2026-11-04 02:05:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1126
Author: @aelnaby
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/security-hardening-v2


📝 Commits (1)

  • e0f7625 Harden server, installer and engine against high-risk bugs

📊 Changes

15 files changed (+357 additions, -75 deletions)

View changed files

📝 chat.py (+12 -1)
📝 docker-entrypoint.sh (+5 -1)
📝 docs/DETAILS.md (+15 -11)
📝 include/strata/artifact/gguf_reader.hpp (+26 -3)
📝 include/strata/core/native_head.hpp (+1 -0)
📝 serve/server.py (+182 -31)
📝 serve/test_security.py (+18 -8)
📝 setup.py (+34 -10)
📝 src/core/layer.cpp (+2 -0)
📝 src/core/native_head.cpp (+3 -0)
📝 src/core/weights.cpp (+22 -2)
📝 src/kernels/ngram.cpp (+2 -1)
📝 src/ngram/ple_reader.cpp (+31 -7)
📝 sycl/src/core/layer.cpp (+2 -0)
📝 sycl/src/core/native_head.cpp (+2 -0)

📄 Description

Re-open of #992, rebased onto the new main after the history cleanup (old PR cannot be reopened).

Server: bounded request bodies (caps layered onto _body, keeping the drain machinery), vision image fetch with per-hop allowlist before connecting (no-redirect opener), connected-peer IP re-check, private/loopback/metadata refusal, size caps, Pillow bomb guards; MCP tools gated on the receiving interface (loopback keyless, LAN needs api_key or mcp_allow_remote); no shell=True in before_load; fail closed on cors ["*"] without api_key; tighter Origin trust.

Installer: safe zip extraction (traversal/symlink refusal, exec bits kept, bad-zip drop), private temp dir for the CUDA keyring, list2cmdline quoting, entrypoint allowlists, image size cap.

Engine: GGUF/PLE/index.txt overflow guards, native embed bound check.

Verified: serve.test_security 23/23 OK, test_setup_risk/pins/config OK, py_compile OK. C++ build needs the CUDA toolchain.


🔄 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/1126 **Author:** [@aelnaby](https://github.com/aelnaby) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/security-hardening-v2` --- ### 📝 Commits (1) - [`e0f7625`](https://github.com/Niko1221/Strata/commit/e0f76255532d0418b06cfd000e63b462a6c68bfe) Harden server, installer and engine against high-risk bugs ### 📊 Changes **15 files changed** (+357 additions, -75 deletions) <details> <summary>View changed files</summary> 📝 `chat.py` (+12 -1) 📝 `docker-entrypoint.sh` (+5 -1) 📝 `docs/DETAILS.md` (+15 -11) 📝 `include/strata/artifact/gguf_reader.hpp` (+26 -3) 📝 `include/strata/core/native_head.hpp` (+1 -0) 📝 `serve/server.py` (+182 -31) 📝 `serve/test_security.py` (+18 -8) 📝 `setup.py` (+34 -10) 📝 `src/core/layer.cpp` (+2 -0) 📝 `src/core/native_head.cpp` (+3 -0) 📝 `src/core/weights.cpp` (+22 -2) 📝 `src/kernels/ngram.cpp` (+2 -1) 📝 `src/ngram/ple_reader.cpp` (+31 -7) 📝 `sycl/src/core/layer.cpp` (+2 -0) 📝 `sycl/src/core/native_head.cpp` (+2 -0) </details> ### 📄 Description Re-open of #992, rebased onto the new main after the history cleanup (old PR cannot be reopened). Server: bounded request bodies (caps layered onto _body, keeping the drain machinery), vision image fetch with per-hop allowlist before connecting (no-redirect opener), connected-peer IP re-check, private/loopback/metadata refusal, size caps, Pillow bomb guards; MCP tools gated on the receiving interface (loopback keyless, LAN needs api_key or mcp_allow_remote); no shell=True in before_load; fail closed on cors ["*"] without api_key; tighter Origin trust. Installer: safe zip extraction (traversal/symlink refusal, exec bits kept, bad-zip drop), private temp dir for the CUDA keyring, list2cmdline quoting, entrypoint allowlists, image size cap. Engine: GGUF/PLE/index.txt overflow guards, native embed bound check. Verified: serve.test_security 23/23 OK, test_setup_risk/pins/config OK, py_compile OK. C++ build needs the CUDA toolchain. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:05:11 +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#3045
No description provided.