# Unauthenticated handler reaches privileged sink

Route or AJAX handler with no caller check that spawns processes, runs SQL, or mutates state

_Area: Web access control and IDOR. Seen in 2 disclosed reports; latest 2026-06-18. Updated 2026-12-05._

## How it works
A request handler performs a privileged action — spawning a process, running SQL, mutating topology — but nothing on the path verifies who is calling. The broken assumption is that "this route is protected" or "only admins reach this page." Protection is opt-in and off by default [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md), attached to the wrong layer so it runs too late [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md), or simply absent on one route group while siblings are guarded [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md)[E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md). The handler then passes caller-supplied input straight to the sink.

## Where it shows up
- Auth flags that default off, e.g. `AUTH_ENFORCE` opt-in, with the service bound to `0.0.0.0` [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md)
- Auth implemented as a result/after-execution filter rather than a pre-handler gate [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md)
- One route group mounted without the middleware its siblings use (compare 401 vs 500 responses) [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md)[E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md)
- Handlers binding body parameters directly into a sink: `command`/`args` to a process launcher [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md), `Editor` to `RunSql` [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md), JSON to a config loader [E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md)
- Type guards that wrap only one call while later calls run unconditionally [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md)

## How to review
For every handler, trace from route registration to the sink and confirm a caller check executes *before* any side effect. The invariant: no privileged sink is reachable unless the caller's identity and role were verified earlier in the same request pipeline. Check the filter/attribute type — a check that runs on result execution is too late [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md). Compare middleware across sibling route groups on the same server [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md)[E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md). Confirm auth defaults are secure, not opt-in [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md).

## How finders spotted it
- Traced an exposed route through its dependency to the process-spawning client, noticed auth only when a flag is set and default `0.0.0.0` binding, then confirmed spawn in-process [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md)
- Read the authorization attribute's base class, saw it was a result filter running after handlers, and that the handler passed body input to `RunSql` unchecked [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md)
- Noticed a route group lacked the OAuth middleware its sibling had (401 vs 500), then code-read the handler for what runs after the type guard [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md)
- Same middleware comparison, then traced the handler into validation code and found fail-fast calls reachable from attacker JSON [E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md)

## Variants seen
- Unauthenticated process spawn via MCP connect endpoint [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md)
- Post-handler auth bypass enabling arbitrary SQL [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md)
- Unauthenticated state mutation plus nil dereference panic [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md)
- Unauthenticated `Fatalf`/`os.Exit` process kill [E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md)

## Impact and severity
Reaches from arbitrary local process spawn as the service user [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md) to full SQL execution [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md) and repeatable denial of service killing the whole process [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md)[E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md). Impact rises when the sink is powerful (SQL, process spawn), when the bypass is class-wide across all admin handlers [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md), and when sibling fail-fast paths keep the DoS alive after one check is hardened [E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md). The nil-deref panic [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md) and `Fatalf` exit [E4](https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md) are separate weaknesses riding the auth gap; the auth gap is what makes them reachable.

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **praisonai (pip)** <= 4.6.48, fixed in 4.6.59: PraisonAI: Missing Authentication for Critical Function and Improper Neutralization of Special Elements used in an OS Co (CVE-2026-57124). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md
- **YAFNET.Core (nuget)** <= 4.0.4, fixed in 4.0.5: YAFNET: Pre-Handler Authorization Bypass on Admin Pages Enables Blind SQL Execution via `/Admin/RunSql` (CVE-2026-43937). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md. Fix: https://github.com/YAFNET/YAFNET/commit/27f7e671f93698f7e014d5d0fb88320248b8aa20

## Evidence
- E1: https://bugbountylibrary.com/r/ghsa%3AGHSA-p75f-6fp4-p57w.md
- E2: https://bugbountylibrary.com/r/ghsa%3AGHSA-xhw7-j96h-c3g5.md
- E3: https://bugbountylibrary.com/r/ghsa%3AGHSA-p9mg-74mg-cwwr.md
- E4: https://bugbountylibrary.com/r/ghsa%3AGHSA-44qj-cghf-9p97.md
