---
id: "CVE-2026-62303"
kind: "vulnerability"
aliases: ["CVE-2026-62303"]
title: "Pistache C++ REST toolkit: long slash paths crash the process"
severity: "medium"
cvss: 5.9
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["c++", "package", "pistache", "self-hosted"]
not_affected_if: ["default-config", "no-long-paths-forwarded"]
published_at: "2026-10-30T19:18:33+00:00"
first_seen_at: "2026-10-30T19:25:30+00:00"
updated_at: "2026-10-30T19:26:31+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-62303", "first_seen_at": "2026-10-30T19:25:30+00:00"}]
---

# Pistache C++ REST toolkit: long slash paths crash the process

Pistache's router collapses consecutive slashes in request paths with a regular expression that recurses on libstdc++, so a path with tens of thousands of slashes exhausts the stack. An unauthenticated remote attacker can crash the server process (denial of service) when the deployment allows long request paths.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the Pistache version in use against the affected range 0.0.5 through 0.4.26.
- Check whether `Endpoint::Options::maxRequestSize()` is raised above the default `4096` bytes, or whether a front end forwards long paths to the service.
- Check whether attacker-controlled strings reach `Router::addRoute()`, `Router::removeRoute()` or `Router::route()` through the direct router API.

## Fix

- Pistache: move past `0.4.26`; the sources say a source fix replaces the recursive normalization with an iterative pass, but no released version containing it was verified at publication.

## Timeline

- 2026-10-30T19:25:30+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-62303

## From the sources

Pistache is a high-performance REST toolkit written in C++. From 0.0.5 through 0.4.26, `SegmentTreeNode::sanitizeResource()` in `src/server/router.cc` uses `std::regex_replace()` with the `//+` expression to collapse consecutive slashes. With libstdc++, a path containing tens of thousands of consecutive slash characters can recurse deeply enough to exhaust the stack and crash the process. `Router::route()`, `Router::addRoute()` and `Router::removeRoute()` reach this normalization. Unauthenticated remote exploitation is conditional on a deployment allowing sufficiently long request paths, such as by increasing `Endpoint::Options::maxRequestSize()` above the default 4096-byte limit or forwarding long paths through a front end. Direct router API use is also affected when attacker-controlled route or resource strings reach the normalizer. Native builds reproduced a crash around 24,000 consecutive slashes, although the exact threshold depends on the stack and standard library; the demonstrated failure is stack exhaustion rather than uninitialized-memory use. A source fix replaces recursive regular-expression normalization with an iterative pass, but no containing repository release was verified as of time of publication.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
