September 25, 2025

Some of the most powerful and sensitive operations in a modern web application happen in the background: data migrations, report generation, internal maintenance. Because these processes run behind the scenes, their access controls are often overlooked.
We recently discovered a textbook example of this in Langfuse, a leading
open-source LLM engineering platform with 16k stars on Github. A subtle flaw in its background job controls allowed any authenticated user to access highly sensitive administrative functions, creating a significant business risk.
The Langfuse team remediated the threat the same day it was reported. This case study breaks down the vulnerability to illustrate a crucial lesson for every engineering leader: the simplest oversight can sometimes create the biggest threat.
A single missing authorization check created two severe, high-impact business risks.
While the code flaw was small, its potential impact was serious. An attacker with a standard, low-privilege account could cause:
The vulnerability was located in the tRPC router responsible for background
migrations. The endpoints to retry, list, and view the status of migrations were secured using tRPC’s protectedProcedure.
This middleware correctly performs authentication, ensuring a user has a valid session. However, it does not perform authorization. It fails to check if that user has administrative privileges. The DepthFirst system identified that, because Langfuse allows self-serve sign-ups, any user could register and gain immediate access to these sensitive administrative controls.
The vulnerable code in background-migrations-router.ts:
An attacker could have exploited this with minimal effort.
backgroundMigrations.all API endpoint to list all ongoing and available migration jobs.backgroundMigrations.retry endpoint on a critical job,

This vulnerability is a textbook example of a common blind spot in modern
development: confusing Authentication (AuthN) with Authorization (AuthZ).
This authorization flaw is an easy oversight for a human developer to make, and an even easier one for an AI assistant. LLMs write code by repeating the most common patterns they have learned. It sees that most API endpoints require a user to be logged in, so it correctly adds an authentication check. However, the LLM lacks the business context to know this specific API controls a sensitive process and requires a stricter authorization check. By repeating the common pattern, it inadvertently introduces a critical vulnerability.
Security teams are blind to the risk from these vulnerabilities because traditional
SAST scanners are unable to identify these flaws. They are pattern-matchers that can verify authentication is present, but they are architecturally incapable of
understanding the business logic that makes an admin API different from a user API.
At DepthFirst, we specialize in finding these exact kinds of contextual business logic flaws: the ones that are invisible to traditional tools but create the most significant business risk.
We privately reported the vulnerability to the Langfuse team in accordance with their security policy. They responded promptly, validating the report and shipping a comprehensive fix the same day, demonstrating their commitment to security.
The solution was to implement a new adminProcedure that enforces role-based authorization, protecting users before the vulnerability could be exploited. In recognition of the report and our collaboration, the Langfuse team has acknowledged DepthFirst in their security Hall of Fame.
This case study highlights how a single, overlooked authorization check can create a critical security risk. These flaws, invisible to traditional scanners, may be hiding in your own applications.

Secure your code to ship faster
Link your Github repo in three clicks.