Security: PATCH /whip and PATCH /whep stubs registered with empty schema — no AJV validation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
Research direction
Start with the PATCH handlers around lines 304–309 in src/api_whip.ts and 303–308 in src/api_whep.ts, and compare their route schemas with the OPTIONS stubs from issue #249. Add matching parameter validation to both routes, then verify that both PATCH stubs still return 405 while rejecting invalid path parameters and request bodies according to the schema.
Written by the indexing model from the issue text.
Description
Summary
The PATCH stubs on both the WHIP and WHEP routes are registered with an empty schema object (`{}`). Fastify/AJV cannot validate path parameters or the request body on these handlers.
Affected Files
- `src/api_whip.ts` — `PATCH /whip/:productionId/:lineId` handler (~line 304–309)
- `src/api_whep.ts` — `PATCH /whep/:productionId/:lineId` handler (~line 303–308)
Current State
```typescript
fastify.patch('/whip/:productionId/:lineId', { schema: {} }, async (request, reply) => {
reply.status(405).send();
});
```
The handlers only return 405 today, but the empty schema means:
- Path parameters (`productionId`, `lineId`) are not validated by AJV.
- Any request body passes through without schema enforcement.
- Inconsistent with every other route in the codebase that carries explicit TypeBox schemas.
Recommendation
Add a minimal TypeBox schema — at minimum a `params` declaration — consistent with how the OPTIONS stubs are handled (see issue #249):
```typescript
import { Type } from '@sinclair/typebox';
const WhipWhepParams = Type.Object({
productionId: Type.String({ minLength: 1, maxLength: 200 }),
lineId: Type.String({ minLength: 1, maxLength: 200 }),
});
fastify.patch(
'/whip/:productionId/:lineId',
{ schema: { params: WhipWhepParams, response: { 405: Type.Object({}) } } },
async (request, reply) => {
reply.status(405).send();
}
);
```
Apply the same fix to the WHEP PATCH stub.
Severity
Low — handlers always return 405; defence-in-depth concern and schema consistency.
Found by automated security audit 2026-07-06.
- Dominant language
- TypeScript
- Stars
- 90
- Forks
- 19
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 35
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Eyevinn/intercom-manager
-
Urgent
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eyevinn/intercom-manager#264 · 1 comment ·
-
Security: No rate limiting on POST /session, POST /production, GET /reauth, POST /share endpoints Openbug Medium
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Eyevinn/intercom-manager#256 ·
-
Security: PATCH /session/:sessionId missing TypeBox body schema — AJV does not validate request body OpenMedium
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Eyevinn/intercom-manager#248 ·
-
bug dependencies Low
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Eyevinn/intercom-manager#246 ·
-
bug dependencies Low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Eyevinn/intercom-manager#245 ·
All issues in Eyevinn/intercom-manager
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100