The bug that survived three years of code review
The motion search endpoint validated the camera name in the URL against the user's permissions but never checked that the supplied job identifier belonged to that camera. An attacker with access to one camera could read motion metadata from any other camera by using a job identifier from that camera.
Cybersecurity
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Frigate is an open source NVR (network video recorder) system that thousands of people run at home to manage their security cameras. Among its features is a search over motion detection history: you pick a camera you have access to, search its events, and get results back. It is an ordinary, easily forgotten feature, and the author notes that this is usually where the good bugs are.
Access to cameras is role based, which makes sense for a shared household or a small business running a dozen cameras with different employees needing different views. You are meant to get access to the cameras you are supposed to see and nothing else. The motion search endpoint looked like this:
GET /api/{camera_name}/search/motion/{job_id}
The camera name sits in the URL and is checked against your permissions. If you are only allowed to see front_yard, the system should stop you from peeking at server_room.
Setup
The work was done as an audit of an open source project rather than against a hosted bug bounty target. The report describes no specific accounts, roles, tool versions or deployment details beyond the role based camera access model: a user holding permission for one camera and not for another. The precondition for the attack is knowledge of a job_id belonging to a motion search run on a camera the attacker cannot access, either known or guessed.
Finding it
The researcher sat with the endpoint because something felt off before it could be articulated. The camera_name is validated, but the actual data comes from a completely separate identifier, the job_id. Nowhere in the code does anything confirm that the job being pulled actually belongs to the camera that was just approved. Two different things are being checked, and only one of them matters.
Exploitation
Step 1: send a request naming an authorised camera with a foreign job
Say the attacker only has access to front_yard. If they know, or can guess, a job_id from a motion search someone else ran on server_room, they send:
GET /api/front_yard/search/motion/{that_job_id}
The permission check passes, because the requester is indeed authorised for front_yard. The response nevertheless hands back server_room's data: timestamps, movement intensity and activity patterns. A camera the attacker was never supposed to have any visibility into is sitting right there in the response.
Root cause
The endpoint authorises the camera name taken from the URL but then fetches the result set by job_id without verifying that the job's own camera field matches the camera that was authorised. The two identifiers are never tied together, so the permission check applies to a value that has no bearing on which data is returned.
What makes the case notable is that the researcher kept reading the codebase afterwards, mostly out of habit, and found another feature performing the exact same kind of lookup, except that one did it correctly: it checked the job's actual camera field rather than whatever camera name happened to be in the URL. Same project, same bug class, same mistake, and somebody had already fixed it once, just not here. The correct pattern existed in the codebase; it simply had not made it everywhere it needed to.
Impact
An attacker with access to any one camera can read motion metadata from cameras they are not authorised for, provided they know or can guess a job_id from a search run on the target camera. The leaked data is motion metadata rather than actual video footage, and the severity discussion with the maintainer landed at Moderate rather than High for that reason.
Fix
The report does not describe the patch itself. The report does not describe the patch. A sibling feature in the same codebase checks the job's actual camera field rather than the camera name in the URL. The issue was submitted through GitHub's private disclosure process, picked up by the maintainer within days, and published as GHSA-vff9-46ww-fjjm.
Variants to test
- Path identifier versus body or query identifier. Look for endpoints where one identifier is authorised (a name or slug in the path) and another selects the data (an ID in the path, query or body). A positive result is a response containing records belonging to an object you were not authorised for.
- Sibling features in the same codebase. When you find one endpoint that validates the wrong value, search for other handlers performing the same lookup. A positive result is a second endpoint with the same mismatch, or, as here, a correctly written sibling that shows what the fix should look like.
- Guessable job identifiers. Where the second identifier is sequential or otherwise predictable, enumerate values against an authorised object and watch for records whose camera or owner field differs from the one you were granted. A positive result is any record outside your permission scope.
- Cross-tenant equivalents. Apply the same pattern to multi-tenant systems: authorise a tenant in the URL, select a resource by ID, and check whether the resource's tenant is ever compared. A positive result is another tenant's metadata in the response.
What happened, in plain words
A security researcher spent time reading the source code of Frigate, a free, open source NVR system. NVR stands for network video recorder: software that runs on a small computer at home and manages security cameras, recording what they see and letting you look back through it. Thousands of people run Frigate at home for exactly that purpose.
Frigate has a feature that lets you search through the history of motion detection. Motion detection is the software noticing that something moved in the camera's picture, and saving a small record of that moment. The search feature lets you pick a camera, search its events, and get results back. It is an ordinary feature: built, tested, shipped and then forgotten about. The researcher notes that this kind of forgotten feature is usually where the interesting bugs are.
A bug, in this context, is a mistake in the code that makes the software do something its authors did not intend. This particular bug let a person who is only allowed to see one camera read motion information from a different camera they were never given access to.
To understand how, you need two ideas.
Roles and permissions. Frigate uses role based camera access. A role is a label attached to a user account that says what that account may do. Here, each user is given permission for certain cameras and not others. That makes sense for a shared household, or for a small business running a dozen cameras where different employees need different views. If you are allowed to see the front yard camera, the system should stop you from peeking at the server room camera.
An API endpoint. An API is the part of a program that other programs talk to, rather than the part a human clicks on. You can think of it as a serving hatch in a restaurant wall: you pass a request through it and get a response back, without going into the kitchen. An endpoint is one specific hatch, one address that accepts one kind of request. Frigate's motion search endpoint looked like this:
GET /api/{camera_name}/search/motion/{job_id}
Line by line, in plain words:
GETis the type of request. It means "give me something back", as opposed to sending something in. When your browser loads a normal web page, it is making a GET request./api/...is the address of the endpoint, the serving hatch. Theapipart signals that this address is meant for programs talking to programs.{camera_name}is a placeholder. When a real request is made, an actual camera name goes there, for examplefront_yard.search/motionsays which feature is being used: searching motion history.{job_id}is a second placeholder. A job is one search that was run. When someone searches motion events, the system starts a job, does the work, and gives that job an identifier so the results can be fetched afterwards. Thejob_idis that identifier.
So the address contains two pieces of information: which camera you claim to be looking at, and which search result you want.
The camera name in the address is checked against your permissions. If you are only allowed to see front_yard, the system should stop you from peeking at server_room. That check is real: it passes for the camera you are authorised for.
The problem is that the actual data does not come from the camera name at all. It comes from the job_id, a completely separate identifier. And nowhere in the code does anything confirm that the job you are pulling actually belongs to the camera you were just approved for. Two different things are being checked, and only one of them matters.
Setup
This was an audit of an open source project, not a test against a company's bug bounty programme. A bug bounty programme is a scheme where an organisation invites outsiders to look for bugs in its systems and report them, sometimes for a reward. An audit here simply means the researcher read the project's code looking for real vulnerabilities: weaknesses that actual companies and people, who rely on the software, could be harmed by.
The report describes no specific accounts, roles, tool versions or deployment details beyond the role based camera access model: a user who holds permission for one camera and not for another. The one thing an attacker needs before trying the attack is knowledge of a job_id belonging to a motion search that was run on a camera they cannot access. They either know such an identifier or guess it.
Finding it
The researcher sat with the endpoint for a while, because something about it felt off before it could be put into words. Reading the code, the camera_name is validated, but the actual data comes from a completely separate identifier, the job_id. Nowhere in the code does anything confirm that the job being pulled actually belongs to the camera that was just approved.
This is a classic shape of mistake. The code asks "may this person look at this camera?" and gets a yes. Then it fetches the results by a different label entirely, without asking whether that label belongs to the same camera. The permission check is real, but it is applied to a value that has no bearing on which data comes back.
Exploitation
Exploitation means actually using the bug to get something you should not have, rather than just suspecting it exists.
Step 1: send a request naming an authorised camera with a foreign job
Say the attacker only has access to front_yard. If they know, or can guess, a job_id from a motion search someone else ran on server_room, they send:
GET /api/front_yard/search/motion/{that_job_id}
Line by line, in plain words:
GETagain means "give me something back"./api/front_yard/...puts the name of a camera the attacker is genuinely allowed to see into the address. This is the part that will be checked.search/motionis the same motion search feature as before.{that_job_id}is the identifier of a search that was run onserver_room, the camera the attacker is not allowed to see. The attacker supplies it in place of their own job identifier.
The permission check passes, because the requester is indeed authorised for front_yard. The response nevertheless hands back server_room's data: timestamps, movement intensity and activity patterns. Timestamps are the times at which motion happened. Movement intensity is how much movement there was. Activity patterns are the shape of that activity over time, for example when a place tends to be busy. A camera the attacker was never supposed to have any visibility into is sitting right there in the response.
Why take this step? Because it tests the suspicion directly. If the system really did tie the job to the camera, this request would fail or return nothing. If it returns another camera's records, the two identifiers are not connected, and the bug is confirmed.
Root cause
The endpoint authorises the camera name taken from the address, but then fetches the result set by job_id without verifying that the job's own camera field matches the camera that was authorised. A field is simply one named piece of information stored about something; a job record has a field saying which camera it belongs to. The two identifiers are never tied together, so the permission check applies to a value that has no bearing on which data is returned.
What makes the case notable is that the researcher kept reading the codebase afterwards, mostly out of habit, and found another feature performing the exact same kind of lookup, except that one did it correctly: it checked the job's actual camera field rather than whatever camera name happened to be in the address. Same project, same bug class, same mistake, and somebody had already fixed it once, just not here. The correct pattern existed in the codebase; it simply had not made it everywhere it needed to.
That is worth pausing on. These bugs do not usually come from nowhere. Somebody already knew the right way to do it. It just did not make it everywhere it needed to.
Impact
Impact means what an attacker can actually get out of the bug. An attacker with access to any one camera can read motion metadata from cameras they are not authorised for, provided they know or can guess a job_id from a search run on the target camera. Metadata is data about events rather than the events themselves: here, the times and amounts of movement, not the pictures.
The leaked data is motion metadata rather than actual video footage. That distinction drove the severity discussion. Severity is a rough measure of how bad a bug is, used to decide how urgently it must be fixed. They went back and forth a bit on severity, and it landed at Moderate rather than High, because what leaked was motion metadata rather than video.
The issue was submitted through GitHub's private disclosure process. GitHub is the website where the project's code is hosted, and its private disclosure process lets a researcher report a security problem to the maintainers privately, so it is not public while it is being fixed. The maintainer picked it up within days, which the researcher notes does not happen often. It was published as GHSA-vff9-46ww-fjjm. A GHSA identifier is the label GitHub gives to a published security advisory, a public notice describing the problem once it is safe to talk about.
Fix
The report does not describe the patch itself. The report does not describe the patch. A sibling feature in the same codebase checks the job's actual camera field rather than the camera name in the address. In plain words: look up the job, see which camera it really belongs to, and compare that with what the person is allowed to see.
Variants to test
A variant is the same mistake wearing different clothes. Once you have found one bug, it is worth looking for its siblings. The researcher's closing advice is exactly this: when you find a bug that is clearly a mistake, go look for its twin. Maintainers fix the bug they know about; they do not always go looking for its twin.
- Path identifier versus body or query identifier. The path is the part of the address before any question mark. A query is the part after a question mark, carrying extra settings. The body is the content sent along with a request that is not a simple GET. Look for endpoints where one identifier is authorised (a name or slug in the path) and another selects the data (an ID in the path, query or body). A positive result is a response containing records belonging to an object you were not authorised for.
- Sibling features in the same codebase. When you find one endpoint that validates the wrong value, search for other handlers performing the same lookup. A handler is the piece of code that deals with a request. A positive result is a second endpoint with the same mismatch, or, as here, a correctly written sibling that shows what the fix should look like.
- Guessable job identifiers. Where the second identifier is sequential or otherwise predictable, enumerate values against an authorised object and watch for records whose camera or owner field differs from the one you were granted. Enumerating means trying values one after another, like 1, 2, 3. A positive result is any record outside your permission scope.
- Cross-tenant equivalents. A tenant is one customer or household sharing a system with others. Apply the same pattern to multi-tenant systems: authorise a tenant in the address, select a resource by ID, and check whether the resource's tenant is ever compared. A positive result is another tenant's metadata in the response.
Glossary
- NVR (network video recorder): software or a device that manages security cameras, records their footage and lets you review it.
- Frigate: the open source NVR system discussed here.
- Open source: software whose source code is published, so anyone can read it, and often improve it.
- Source code: the human-readable instructions that make up a program.
- Bug: a mistake in code that makes software behave in a way its authors did not intend.
- Vulnerability: a weakness in software that someone could use to cause harm or gain access they should not have.
- Audit: a careful review of code or a system, here looking for vulnerabilities.
- Motion detection: software noticing that something moved in a camera's picture and saving a record of it.
- Motion metadata: data about motion events, such as times, intensity and patterns, rather than the video itself.
- Role based access: giving each user account a role that decides which things it may see or do.
- Permission: the specific right to access something, such as one camera.
- API: the part of a program that other programs talk to, rather than the part a human clicks on.
- Endpoint: one specific address in an API that accepts one kind of request.
- GET: the type of request that asks for something back, as when a browser loads a page.
- URL / path: the address of a request; the path is the part before any question mark.
- Query: the part of an address after a question mark, carrying extra settings.
- Body: content sent along with a request that is not a simple GET.
- Parameter / placeholder: a named slot in an address that is filled with a real value when a request is made.
- Identifier / ID: a value that uniquely names one thing, such as one camera or one search job.
- Job: one search that was run, given an identifier so its results can be fetched afterwards.
- Field: one named piece of information stored about something, such as the camera a job belongs to.
- Validate: check that a value is acceptable, for example that a camera name exists and the user may see it.
- Authorise: decide whether a user is allowed to do the thing they are asking for.
- Exploitation: actually using a bug to obtain something you should not have.
- Root cause: the underlying mistake in the code that produces the bug.
- Bug class: a category of mistake that can appear in many places, such as checking the wrong identifier.
- Impact: what an attacker can actually get out of a bug.
- Severity: a rough measure of how bad a bug is, used to decide how urgently it must be fixed.
- Patch / fix: the change to the code that removes the bug.
- Maintainer: the person or people who look after an open source project.
- GitHub: the website where the project's code is hosted.
- Private disclosure: reporting a security problem privately to the maintainers so it is not public while it is being fixed.
- GHSA identifier: the label GitHub gives to a published security advisory.
- Security advisory: a public notice describing a security problem once it is safe to talk about.
- Handler: the piece of code that deals with a request.
- Enumerate: try values one after another, such as 1, 2, 3, to find one that works.
- Tenant: one customer or household sharing a system with others.
- Multi-tenant: a system serving several tenants from the same installation.
- Variant: the same kind of mistake appearing in a different place or form.