Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-9999-Serverless-Event-Injection-to-Code-Overwrite — Proof-of-concept exploit for CVE-2026-9999, demonstrating path traversal in serverless object storage events that overwrites function source code to achieve RCE. | Kitploit
Tools/GitHubGitHub/george0papasotiriou/cve-2026-9999-serverless-event-injection-to-code-overwrite
Cloud Infrastructure SecurityVulnerability AnalysisExploitationServerless SecurityCloud SecurityLearning & Education
GitHubgeorge0papasotiriou/cve-2026-9999-serverless-event-injection-to-code-overwrite

CVE-2026-9999-Serverless-Event-Injection-to-Code-Overwrite

Proof-of-concept exploit for CVE-2026-9999, demonstrating path traversal in serverless object storage events that overwrites function source code to achieve RCE.

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
View Repository
101 month agoNot yet reviewed
Share

3. CVE-2026-9999 – Serverless Function Event Injection (Path Traversal → Code Overwrite)

Overview

A serverless platform that processes object storage events does not sanitize the object.key field, allowing an attacker to overwrite the function’s source code via path traversal.

Severity: Critical (RCE on next invocation)

Exploit & Simulation (Python)

root@kitploit:~
#!/usr/bin/env python3
"""
vulnerable_serverless.py - Simulated AWS Lambda-like runtime with event injection.
"""
import json, os, shutil, subprocess
from http.server import HTTPServer, BaseHTTPRequestHandler

FUNCTION_DIR = "/tmp/function"
os.makedirs(FUNCTION_DIR, exist_ok=True)
# initial function code
with open(os.path.join(FUNCTION_DIR, "handler.py"), "w") as f:
    f.write("""
def handler(event):
    return "Hello, " + event.get('name', 'world')
""")

class Handler(BaseHTTPRequestHandler):
    def do_POST(self):
        content_length = int(self.headers['Content-Length'])
        body = self.rfile.read(content_length)
        event = json.loads(body)
        # Vulnerable: use event['key'] to decide which file to load?
        # Simulate: the function source is overwritten by an "update" event from storage.
        if event.get('source') == 'storage':
            # Path traversal in object key
            object_key = event['object']['key']  # attacker controlled
            # Overwrite handler.py with the object content (simulated)
            dst = os.path.join(FUNCTION_DIR, "handler.py")
            # directory traversal to write outside? But we want to overwrite handler.py.
            # Attack: object.key = "../../../tmp/function/handler.py"
            # Normalize to ensure it's within FUNCTION_DIR? No validation!
            # The "get object" would fetch the file; here we just write injected code.
            injected_code = event.get('code', '# no code')
            # Resolve the full path – this is the vulnerability:
            full_path = os.path.normpath(os.path.join(FUNCTION_DIR, object_key))
            # Only check if it is under FUNCTION_DIR? Not present.
            with open(full_path, 'w') as f:
                f.write(injected_code)
            self.send_response(200)
            self.end_headers()
            self.wfile.write(b"Update applied")
        else:
            # Execute current handler (for demo)
            import handler
            result = handler.handler(event)
            self.send_response(200)
            self.end_headers()
            self.wfile.write(result.encode())

server = HTTPServer(('0.0.0.0', 8000), Handler)
server.serve_forever()

CVE-2026-9999 – Serverless Event Injection to Code Overwrite

Severity: Critical

📖 Overview

A path traversal vulnerability in a serverless platform’s event processing allows an attacker to overwrite the function’s source code, leading to remote code execution on subsequent invocations.

⚙️ Vulnerability Details

  • Type: Path Traversal / Insecure File Write
  • Impact: Remote Code Execution (RCE)
  • Root Cause: The platform trusts the object.key field from storage events without sanitization, allowing ../ sequences to write to arbitrary paths within the function sandbox.

🧪 Exploit Demonstration

  1. Start the vulnerable runtime:
    root@kitploit:~
    python vulnerable_serverless.py
    
  2. Run the exploit:
    root@kitploit:~
    python exploit_event_injection.py
    
Download Tool