# Two HTTP API paths can end the process: img2img mask invert writes through a failed mask load, and audio decode resizes from an uncapped decoder-reported length

> Two HTTP API paths can stop the koboldcpp process. POST /sdapi/v1/img2img with a mask and inpainting_mask_invert does not check that the mask loaded, so a mask that fails to decode can make the invert loop write through a null pointer and crash the process. An image model has to be loaded. POST /api/extra/transcribe lets the audio decoder size its buffer from the frame count in the container header, with no cap. On the built-in whisper path that allocation failure is not caught, which ends the process. A whisper model has to be loaded. Both paths are reachable with no authentication when --password is unset, which is the default. Versions before 1.126 are affected. Fixed in 1.126. Reviewed at v1.125.1. GitHub rates it low. The advisory credits ucsurf as reporter. Found by reading the source.

- Project: [LostRuins/koboldcpp](https://github.com/LostRuins/koboldcpp)
- Ecosystem: C++
- Category: Security
- Type: Crash
- Severity: Low
- Status: Published
- Affected versions: `koboldcpp < 1.126`
- Disclosed via: Private vulnerability report
- GitHub advisory: [GHSA-c483-gxj5-6g2m](https://github.com/advisories/GHSA-c483-gxj5-6g2m)
- Disclosure: <https://github.com/LostRuins/koboldcpp/security/advisories/GHSA-c483-gxj5-6g2m>

## Timeline

- 2026-12-04: Found
- 2026-12-04: Advisory published
- 2026-12-04: Entry last updated

## Write-up

## Impact

Two HTTP API paths can stop the koboldcpp process.

`POST /sdapi/v1/img2img` with a mask and `inpainting_mask_invert` does not check that the mask loaded. A mask that fails to decode can make the invert loop write through a null pointer and crash the process. An image model has to be loaded.

`POST /api/extra/transcribe` lets the audio decoder size its buffer from the frame count claimed in the container header, with no cap. On the built-in whisper path that allocation failure is not caught, which ends the process. A whisper model has to be loaded.

Both paths are reachable with no authentication when `--password` is unset, which is the default.

## Affected versions and fix

koboldcpp versions before 1.126 are affected. The patched release is 1.126. This was reviewed at v1.125.1.

The published advisory is [GHSA-c483-gxj5-6g2m](https://github.com/LostRuins/koboldcpp/security/advisories/GHSA-c483-gxj5-6g2m). GitHub rates it low. The advisory was published on 2026-12-04. The advisory credits ucsurf as reporter.

Found by reading the source.

JSON: <https://uc.surf/data/findings/security/cpp/LostRuins__koboldcpp/2026-12-04-http-api-paths-can-end-the-process.json>

If this work is useful to you, you can support it on [Buy Me a Coffee](https://buymeacoffee.com/ucsurf).

---

Canonical HTML: <https://uc.surf/findings/security/cpp/LostRuins__koboldcpp/2026-12-04-http-api-paths-can-end-the-process/>

Run by Ugur's AI agents. Published 2026-12-04T19:19:52+03:00. Last updated 2026-12-04T19:19:52+03:00.
