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-22738-POC — Proof-of-concept exploit for CVE-2026-22738, a critical SpEL injection RCE in Spring AI SimpleVectorStore, demonstrating unauthenticated OS command execution. | Kitploit
Tools/GitHubGitHub/n0n4m3x41/cve-2026-22738-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPapers & ResearchLearning & Education
GitHubn0n4m3x41/cve-2026-22738-poc

CVE-2026-22738-POC

Proof-of-concept exploit for CVE-2026-22738, a critical SpEL injection RCE in Spring AI SimpleVectorStore, demonstrating unauthenticated OS command execution.

View Repository
13245 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-22738 — SpEL Injection RCE in Spring AI SimpleVectorStore

CVSS CWE Status

Unauthenticated remote code execution via Spring Expression Language (SpEL) injection in SimpleVectorStore.similaritySearch().

Affected Versions

| Flag | Default | Description | |---|---|---| | `--target` | `http://localhost:8082` | Base URL of the vulnerable application | | `--wait` | off | Poll until the target is ready (useful after `docker compose up`) |
ArtifactVulnerableFixed
org.springframework.ai:spring-ai-core1.0.0 – 1.0.41.0.5
org.springframework.ai:spring-ai-core1.1.0-M1 – 1.1.31.1.4

Fix commit: ba9220b22383e430d5f801ce8e4fa01cf9e75f29


Vulnerability

SimpleVectorStore.similaritySearch() passes the caller-supplied filter key name verbatim into a SpEL template evaluated by StandardEvaluationContext. Because StandardEvaluationContext exposes the full JVM reflection API, an attacker can inject:

root@kitploit:~
T(java.lang.Runtime).getRuntime().exec(...)

into the filter key to achieve unauthenticated OS command execution.

Bypass Details

Naïve injection does not work out of the box — two parser quirks must be navigated:

  1. Single-quote stripping — a key starting with ' is treated as a quoted string; the outer quotes are stripped, mangling the payload.
  2. Double-quote wrapper — wrapping the payload in "..." causes the parser to strip the outer double-quotes, leaving the inner SpEL expression intact as the key value passed to #metadata['<KEY>'].
  3. Empty metadata key — using #metadata[''] on both sides of the injected expression (instead of an undefined variable) avoids an unknown variable SpEL error while still triggering exec().

The resulting evaluated expression takes the form:

root@kitploit:~
#metadata[''] + T(java.lang.Runtime).getRuntime().exec(new String[]{'/bin/bash','-c','<cmd>'}) + #metadata[''] == 'x'

Success Indicator

The HTTP response body will contain EL1030E — the SpEL runtime error:

root@kitploit:~
operator ADD not supported between null and java.lang.ProcessImpl

This error is raised after exec() returns, confirming OS-level command execution without requiring an out-of-band callback.


Usage

Prerequisites:

root@kitploit:~
pip install requests

Run the exploit:

root@kitploit:~
python3 exploit.py [--target http://localhost:8082] [--wait]
image

Docker Desktop (macOS/Windows): use host.docker.internal instead of 127.0.0.1 for callback payloads.


Exploit Steps

The PoC runs five sequential steps:

StepDescription
1Baseline check — confirm the endpoint is reachable and returns seeded data
2Blind SpEL probe — read java.version via T(java.lang.System) to confirm injection point
3RCE: touch /tmp/pwned_cve_2026_22738 inside the container
4RCE: write id / uname / hostname output to /tmp/rce_proof.txt
5Verify via docker exec — print proof file contents

Disclaimer

This proof-of-concept is provided for educational and authorized security testing purposes only. Do not use against systems you do not own or have explicit written permission to test.

Download Tool