id: CVE-2026-21858

info:
  name: n8n Webhooks - Remote Code Execution
  author: rxerium
  severity: critical
  description: |
    n8n is an open source workflow automation platform. Versions starting with 1.65.0 and below 1.121.0 enable an attacker to access files on the underlying server through execution of certain form-based workflows. A vulnerable workflow could grant access to an unauthenticated remote attacker, resulting in exposure of sensitive information stored on the system and may enable further compromise depending on deployment configuration and workflow usage. This issue is fixed in version 1.121.0.
  impact: |
    Unauthenticated remote attackers can access sensitive files, potentially leading to information disclosure and further system compromise.
  remediation: |
    Update to version 1.121.0 or later.
  reference:
    - https://thehackernews.com/2026/01/critical-n8n-vulnerability-cvss-100.html
    - https://nvd.nist.gov/vuln/detail/CVE-2026-21858
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
    cvss-score: 10.0
    cve-id: CVE-2026-21858
    epss-score: 0.72023
    epss-percentile: 0.99354
    cwe-id: CWE-20
  metadata:
    verified: true
    max-request: 1
    shodan-query: http.favicon.hash:-831756631
  tags: cve,cve2026,n8n,workflow,rce,passive,vkev

http:
  - method: GET
    path:
      - "{{BaseURL}}/signin"

    extractors:
      - type: regex
        name: base64_content
        group: 1
        regex:
          - '<meta name="n8n:config:sentry" content="([A-Za-z0-9+/=]+)"'
        internal: true

      - type: dsl
        name: decoded
        dsl:
          - 'base64_decode(base64_content)'
        internal: true

      - type: dsl
        name: version
        dsl:
          - 'replace_regex(base64_decode(base64_content), ".*n8n@([0-9]+\\.[0-9]+\\.[0-9]+).*", "$1")'
        internal: true

      - type: dsl
        dsl:
          - '"n8n Version: " + version'

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "<title>n8n.io"
        case-insensitive: true

      - type: status
        status:
          - 200

      - type: dsl
        name: vulnerable
        dsl:
          - compare_versions(version, '>= 1.65.0', '< 1.121.0')
# digest: 4a0a00473045022100da1b7f32b00e168e940c4b8b3e324aec5f3d4fa16691e0ded7415efca1efd5e602203fed64b38017dedfde15843efa8189d821613b03ac705fea3a7acde1ba928485:922c64590222798bb761d5b6d8e72950