Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/chat-peg-parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ void common_chat_peg_mapper::map(const common_peg_ast_node & node) {
result.tool_calls.push_back(pending_tool_call.value());
}
pending_tool_call.reset();
current_tool = nullptr;
}
}
}
Expand Down
26 changes: 26 additions & 0 deletions docs/eliza-security-advisories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Eliza fork: upstream security advisories

This fork is based on ggml-org llama.cpp `b9159`. Upstream security fixes
reach it only by a rebase or a cherry-pick. Before you move the elizaOS
`plugins/plugin-local-inference/native/llama.cpp` gitlink to a new fork
commit, do these steps:

1. Read the ggml-org advisories:
`gh api repos/ggml-org/llama.cpp/security-advisories`.
2. Search OSV for llama.cpp CVEs that are not in that list (many are filed
only as CVEs): `https://api.osv.dev/v1/query` with the package
`github.com/ggml-org/llama.cpp`.
3. For each fix commit, check `git merge-base --is-ancestor <fix> HEAD`.
If it is missing, cherry-pick it with `git cherry-pick -x`.
4. Update the table below.

Keep `GGML_RPC` off in every Eliza build. The RPC server has an open
unauthenticated remote code execution advisory with no upstream fix.

| Advisory | Component | Status in this fork |
| --- | --- | --- |
| CVE-2026-107183 (use-after-free, chat PEG parser) | `common/chat-peg-parser.cpp` | Fixed: cherry-pick of ggml-org `dbe4c3e` (#29942). |
| CVE-2026-52132 (`/rerank` negative `top_n`, DoS) | `tools/server` | Fixed in the fork: a negative `top_n` returns HTTP 400. No ggml-org fix yet. |
| GHSA-j8rj-fmpv-wcxw / CVE-2026-34159 (RPC `GRAPH_COMPUTE`, RCE) | `ggml-rpc` | No upstream fix. Not built: `GGML_RPC` is off. |
| CVE-2026-86317 (RPC `deserialize_tensor` assertion) | `ggml-rpc` | No upstream fix. Not built: `GGML_RPC` is off. |
| GGUF parser and tokenizer advisories up to GHSA-96jg-mvhq-q7q7 | `ggml/src/gguf.cpp`, `src/llama-vocab.cpp` | Fixed in the `b9159` base. |
5 changes: 5 additions & 0 deletions tools/server/server-context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4597,6 +4597,11 @@ void server_routes::init_routes() {
}

int top_n = json_value(body, "top_n", (int)documents.size());
if (top_n < 0) {
// a negative top_n made format_response_rerank resize to a huge size (CVE-2026-52132)
res->error(format_error_response("\"top_n\" must be a non-negative integer", ERROR_TYPE_INVALID_REQUEST));
return res;
}

// create and queue the task
json responses = json::array();
Expand Down
13 changes: 13 additions & 0 deletions tools/server/tests/unit/test_rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ def test_invalid_rerank_req(documents):
assert "error" in res.body


@pytest.mark.parametrize("field", ["documents", "texts"])
def test_rerank_negative_top_n(field):
global server
server.start()
res = server.make_request("POST", "/rerank", data={
"query": "Machine learning is",
field: TEST_DOCUMENTS,
"top_n": -1,
})
assert res.status_code == 400
assert "error" in res.body


@pytest.mark.parametrize(
"query,doc1,doc2,n_tokens",
[
Expand Down
Loading