Inbox subscriber can read and modify another subscriber's topic subscription by identifier
Description
Inbox Subscriber Can Read and Modify Another Subscriber's Topic Subscription by Identifier
Report Metadata
- Target: Novu
- Product area: Inbox, topic subscriptions, subscriber authorization
- Verified against: self-hosted Novu 3.15.0
- Finding type: broken access control, subscriber-to-subscriber IDOR
- Suggested severity: High
- Confidence: High
Executive Summary
Novu exposes inbox topic subscription endpoints to authenticated subscriber JWTs, but the read and update flows authorize by topicKey + subscription identifier + environment + organization and do not bind the lookup to the authenticated subscriber.
I verified end to end that one inbox subscriber can:
- read another subscriber's topic subscription by calling
GET /v1/inbox/topics/:topicKey/subscriptions/:identifier - rename that other subscriber's topic subscription by calling
PATCH /v1/inbox/topics/:topicKey/subscriptions/:identifier
This is a real subscriber-to-subscriber authorization bypass inside the same environment. The attacker only needs a valid subscriber JWT plus knowledge of the victim subscription identifier and topic key.
Vulnerability Classification
- Category: broken access control / IDOR
- Boundary crossed:
- one authenticated inbox subscriber to another subscriber's subscription object
- Primary impacts:
- confidentiality
- integrity
Security Expectation
Inbox subscriber routes should be scoped to the authenticated subscriber identity.
More concretely:
- a subscriber JWT should only be able to retrieve subscriptions owned by that same subscriber
- a subscriber JWT should only be able to update subscriptions owned by that same subscriber
- knowledge of
topicKeyandidentifiershould not be enough to access another subscriber's subscription
Affected Functionality
Verified vulnerable endpoints:
GET /v1/inbox/topics/:topicKey/subscriptions/:identifierPATCH /v1/inbox/topics/:topicKey/subscriptions/:identifier
Related code areas:
apps/api/src/app/inbox/inbox.topic.controller.tsapps/api/src/app/subscriptions/usecases/get-subscription/get-subscription.usecase.tsapps/api/src/app/subscriptions/usecases/update-subscription/update-subscription.usecase.ts
Verified proof file:
apps/api/src/app/inbox/e2e/subscription-ownership-idor.e2e.ts
Root Cause Summary
The issue comes from combining two behaviors:
- the inbox subscriber routes accept an authenticated subscriber JWT
- the downstream read and update use cases query subscriptions without requiring
_subscriberIdto match the authenticated subscriber
That means subscription ownership is effectively reduced to possession of the subscription identifier.
Relevant Code Analysis
1. Inbox Subscriber Controller Does Not Pass Subscriber Ownership to Read and Update Use Cases
In apps/api/src/app/inbox/inbox.topic.controller.ts:
GET /topics/:topicKey/subscriptions/:identifierbuildsGetSubscriptionCommandwith environment, organization, topic key, identifier, and context keysPATCH /topics/:topicKey/subscriptions/:identifierbuildsUpdateSubscriptionCommandwith environment, organization, topic key, identifier, and context keys
Neither call includes the authenticated subscriber's internal id for ownership enforcement.
2. Read Path Looks Up Subscription Without _subscriberId
In apps/api/src/app/subscriptions/usecases/get-subscription/get-subscription.usecase.ts, the lookup uses:
_environmentId_organizationIdtopicKeyidentifier- optional context filter
It does not require _subscriberId to match the authenticated subscriber session.
As a result, any subscriber who knows the identifier can retrieve the target subscription object.
3. Update Path Also Looks Up Subscription Without _subscriberId
In apps/api/src/app/subscriptions/usecases/update-subscription/update-subscription.usecase.ts, the subscription lookup uses:
identifier_environmentId_organizationId_topicId- optional context filter
It likewise omits subscriber ownership.
After resolving that subscription, the code updates the same stored subscription document, so the attacker can modify victim-owned subscription metadata such as name.
4. Delete Path Shows the Intended Boundary
As a useful negative control, apps/api/src/app/inbox/usecases/delete-subscription/delete-subscription.usecase.ts does include:
_subscriberId: command._subscriberId
That route correctly rejects cross-subscriber deletion, which helps isolate the bug to the missing ownership checks on the read and update paths rather than a broader intended product behavior.
Attack Preconditions
The attacker needs:
- a valid inbox subscriber JWT in the victim environment
- the victim subscription identifier
- the victim topic key
The attacker does not need:
- dashboard access
- API key access
- organization member access
- victim interaction
Step-by-Step Reproduction
Test Setup
Use one environment with two different inbox subscribers:
- victim subscriber
- attacker subscriber
As the victim subscriber, create a topic subscription:
POST /v1/inbox/topics/<topicKey>/subscriptions HTTP/1.1
Authorization: Bearer <victim-subscriber-jwt>
Content-Type: application/json
{
"identifier": "subscription-123",
"name": "Victim Subscription"
}Reproduction A: Read Another Subscriber's Subscription
As the attacker subscriber, request:
GET /v1/inbox/topics/<topicKey>/subscriptions/subscription-123 HTTP/1.1
Authorization: Bearer <attacker-subscriber-jwt>Expected behavior:
- the request should return
204or another access-denied result because the subscription belongs to a different subscriber
Actual behavior:
- the request succeeds
- the attacker receives the victim subscription details, including its identifier and name
Reproduction B: Rename Another Subscriber's Subscription
As the attacker subscriber, request:
PATCH /v1/inbox/topics/<topicKey>/subscriptions/subscription-123 HTTP/1.1
Authorization: Bearer <attacker-subscriber-jwt>
Content-Type: application/json
{
"name": "Attacker Renamed"
}Expected behavior:
- the request should be rejected because the attacker does not own the subscription
Actual behavior:
- the request succeeds
- the victim subscription record is updated
Verified follow-up:
- when the victim subscriber reads the same subscription again, the stored name is now
Attacker Renamed
End-to-End Verification
I verified this behavior end to end with a real API harness and persisted database state.
Verification artifact:
apps/api/src/app/inbox/e2e/subscription-ownership-idor.e2e.ts
Observed test result:
3 passing
The proof performs the following:
- initialize one environment
- create two distinct inbox subscriber sessions in that same environment
- create a subscription as the victim subscriber
- read that subscription as the attacker subscriber and verify the victim data is returned
- update that subscription as the attacker subscriber and verify the change is persisted
- attempt deletion as the attacker subscriber and verify that deletion is correctly rejected as a negative control
Impact
This is a concrete subscriber-boundary break.
Practical consequences include:
- unauthorized reading of another subscriber's topic subscription metadata
- unauthorized tampering with another subscriber's subscription naming and preference container
- subscriber-to-subscriber abuse in shared environments where identifiers can be learned, logged, or guessed from application flows
If topic subscriptions are used to drive subscriber-specific preference logic, this can also undermine trust in per-subscriber workflow targeting and preference management.
Why This Is In Scope
- this is a real authorization bypass between two different subscribers
- it has concrete confidentiality and integrity impact
- it is not DoS-only
- it does not rely on MITM, physical access, or social engineering
- it is not content spoofing without an attack path
Recommended Fix
Enforce subscriber ownership on all inbox subscriber subscription routes.
Concrete remediation:
- include the authenticated subscriber internal id in the read and update commands
- require
_subscriberIdin the subscription lookup for:
GetSubscriptionUpdateSubscriptionUsecase
- review all inbox subscriber routes that currently authorize by identifier only and ensure they consistently enforce subscriber ownership
- add regression tests proving one subscriber cannot read or update another subscriber's subscription, while legitimate same-subscriber access still works
Suggested Retest
After the fix:
- create a subscription as subscriber A
- authenticate as subscriber B in the same environment
- attempt:
GET /v1/inbox/topics/:topicKey/subscriptions/:identifierPATCH /v1/inbox/topics/:topicKey/subscriptions/:identifier
- confirm both are rejected or return no result
- confirm subscriber A can still read and update their own subscription successfully