Close the NVDB-reported JWT, SQLi, file-read and create-app gaps (F068)
fix(security): close the NVDB-reported JWT, SQLi, file-read and create-app gaps (F068)
Close the NVDB-reported JWT, SQLi, file-read and create-app gaps (F068)b98e2b-fix-close-the-nvdb-reported-jwt-sqli-file-read-cve-2026-130840fixclose nvdb reported jwt sqli file
Committed by dolphin
commit message
fix(security): close the NVDB-reported JWT, SQLi, file-read and create-app gaps (F068)
Five vulnerabilities from the NVDB 2026-09-02 batch (the workflow code-node
sandbox is deliberately left for a separate feature):
- JWT: drop the hard-coded signing secret. config.yaml `jwt_secret` wins when
set and not one of the two leaked historical defaults; otherwise a random
secret is generated once and stored in the config table so every api/worker
process shares it. Existing login cookies are invalidated on upgrade.
- Knowledge space children/search: `order_field` / `order_sort` were f-stringed
into ORDER BY. Endpoints now type them with Literal aliases (422 otherwise)
and the DAO re-validates before building SQL.
- HTML ingestion: `file://` and relative media references resolved against the
extraction dir could copy any server file into MinIO. Local media is now only
accepted from under the source HTML's own directory (symlinks resolved).
- `file_download` / `async_file_download`: a bare local path was returned as
soon as it existed (finetune preset upload reached MinIO with /etc/passwd).
Local paths must resolve under the download cache dir or the system tempdir.
- Create workflow / create assistant only checked quota; `create_app` in
web_menu hid the button but not the API. Both endpoints now depend on
`UserPayload.get_app_creator_user` (super admin or effective `create_app`).
Docs: release-contract F068 + INV-36, deployment guide `jwt_secret` semantics
and v3.0 upgrade note, commented example in the shipped config.yaml.Editor assessment
This commit patches CVE-2026-130840. Unusually thorough. The body walks through five distinct vulnerabilities with the mechanism and the remedy for each: the hard-coded JWT secret and its replacement policy, f-stringed order_field and order_sort now typed with Literal aliases, file:// media references confined to the source HTML directory, local download paths restricted to cache or temp, and create_app enforced on the API rather than hidden in the UI. The subject is long and carries a ticket code, which is the only reason it stops at 4.