Mongoosejs Mongoose
Mongoose before 8.9.5 can improperly use a nested $where filter with a populate() match, leading to search injection. NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 6.0.0, < 6.13.6
- >= 7.0.0, < 7.8.4
- >= 8.0.0, < 8.9.5
Fixed in 6.13.6, 7.8.4, 8.9.5
Mitigation
Upgrade Mongoose to 6.13.6 or 7.8.4 or 8.9.5 or later.
References
Timeline
Days relative to CVE publicationFirst public PoC 218 days after publication; not in CISA KEV. First PoC: nuclei template: Mongoose - NoSQL Injection (nuclei template, 20 Aug 2025).
PoC repositories
Found on GitHub.1 PoCs · 1 pending
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| open-flaw/CVE-2025-23061 | 11 Dec 2025 +330 d | 0 | PoC
Flags · score 30
Below the suspicion threshold (50); does not change the assessment. |
Pending 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| amikanev/CVE-2025-23061-LAB | 6 Apr 2026 +1.2 y | 0 | Pending
Flags · score 15
Below the suspicion threshold (50); does not change the assessment. |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| nuclei template | nuclei template: Mongoose - NoSQL Injection | 20 Aug 2025 | 14 Nov 2026 |
PoC characteristics
What to hunt for in your logs · from 1 PoC repoGET /posts
- Query
authorMatch={"$and":[{"$where":...}]}- Ports
- 3000
- Seen in
- 1 repo: open-flaw/CVE-2025-23061
- Evidence
- open-flaw/CVE-2025-23061/exploit.js:15-54 open-flaw/CVE-2025-23061/server.js:66-94
GET /posts-2
- Query
query={"path":"author","match":[{"$or":[{"$where":...}]}]}- Content-Type
application/json- Ports
- 3000
- Seen in
- 1 repo: open-flaw/CVE-2025-23061
- Evidence
- open-flaw/CVE-2025-23061/exploit.js:129 open-flaw/CVE-2025-23061/exploit.js:142-152 open-flaw/CVE-2025-23061/server.js:97-114
POST /setup
- Content-Type
application/json- Ports
- 3000
- Seen in
- 1 repo: open-flaw/CVE-2025-23061
- Evidence
- open-flaw/CVE-2025-23061/exploit.js:98
POST /posts/search
- Body markers
"authorMatch":{"$and":[{"$where":"this.isAdmin === true"}]}inapplication/json- Ports
- 3000
- Seen in
- 1 repo: open-flaw/CVE-2025-23061
- Evidence
- open-flaw/CVE-2025-23061/exploit.js:114-118 open-flaw/CVE-2025-23061/server.js:117-139
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/posts\?(?:.*&)?authorMatch=\{"\$and":\[\{"\$where":\.\.\.\}\]\}
(?i)^/posts-2\?(?:.*&)?query=\{"path":"author","match":\[\{"\$or":\[\{"\$where":\.\.\.\}\]\}\]\}
(?i)^/setup(?:[?#].*)?$
(?i)^/posts/search(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET [3000] (msg:"GG PoC-Monitor CVE-2025-23061 mongoosejs Mongoose exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/posts"; http.uri; content:"authorMatch={|22|$and|22|:[{|22|$where|22|:...}]}"; reference:url,poc.griffinguard.io/cve/CVE-2025-23061; classtype:web-application-attack; sid:9014612; rev:1;)
alert http any any -> $HOME_NET [3000] (msg:"GG PoC-Monitor CVE-2025-23061 mongoosejs Mongoose exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/posts-2"; http.uri; content:"query={|22|path|22|:|22|author|22|,|22|match|22|:[{|22|$or|22|:[{|22|$where|22|:...}]}]}"; reference:url,poc.griffinguard.io/cve/CVE-2025-23061; classtype:web-application-attack; sid:9612587; rev:1;)
alert http any any -> $HOME_NET [3000] (msg:"GG PoC-Monitor CVE-2025-23061 mongoosejs Mongoose exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/setup"; reference:url,poc.griffinguard.io/cve/CVE-2025-23061; classtype:web-application-attack; sid:9313440; rev:1;)
alert http any any -> $HOME_NET [3000] (msg:"GG PoC-Monitor CVE-2025-23061 mongoosejs Mongoose exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/posts/search"; http.request_body; content:"|22|authorMatch|22|:{|22|$and|22|:[{|22|$where|22|:|22|this.isAdmin === true|22|}]}"; reference:url,poc.griffinguard.io/cve/CVE-2025-23061; classtype:web-application-attack; sid:9206067; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: mongoosejs Mongoose exploit attempt (CVE-2025-23061)
id: gg-pocmon-cve-2025-23061-9014612
status: experimental
description: Request pattern taken from public PoCs for CVE-2025-23061. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2025-23061
logsource:
category: webserver
detection:
selection:
cs-method: GET
cs-uri-stem|contains|all:
- '/posts'
cs-uri-query|contains|all:
- 'authorMatch={"$and":[{"$where":...}]}'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2025.23061
title: mongoosejs Mongoose exploit attempt (CVE-2025-23061)
id: gg-pocmon-cve-2025-23061-9612587
status: experimental
description: Request pattern taken from public PoCs for CVE-2025-23061. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2025-23061
logsource:
category: webserver
detection:
selection:
cs-method: GET
cs-uri-stem|contains|all:
- '/posts-2'
cs-uri-query|contains|all:
- 'query={"path":"author","match":[{"$or":[{"$where":...}]}]}'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2025.23061
title: mongoosejs Mongoose exploit attempt (CVE-2025-23061)
id: gg-pocmon-cve-2025-23061-9313440
status: experimental
description: Request pattern taken from public PoCs for CVE-2025-23061. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2025-23061
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/setup'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2025.23061
title: mongoosejs Mongoose exploit attempt (CVE-2025-23061)
id: gg-pocmon-cve-2025-23061-9206067
status: experimental
description: Request pattern taken from public PoCs for CVE-2025-23061. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2025-23061
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/posts/search'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2025.23061