cwe-917-expression-language-injection

Replace StandardEvaluationContext with SimpleEvaluationContext to remediate CWE-917 in Java Spring SpEL.

3|1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-917-expression-language-injection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cwe-917-expression-language-injection
Source: https://github.com/DevelopersCoffee/java-cwe-security-skills/tree/main/cwe-917-expression-language-injection
Command: npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-917-expression-language-injection

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses Expression Language Injection vulnerabilities in Java applications, preventing potential security breaches and ensuring secure code execution.

Core Features & Use Cases

  • Vulnerability Remediation: Provides deterministic fixes for CWE-917.
  • Secure Coding Practices: Guides developers on using SimpleEvaluationContext over StandardEvaluationContext.
  • Use Case: When a SAST tool flags an Expression Language Injection vulnerability in your Spring application, use this skill to apply the recommended secure coding pattern.

Quick Start

Use the cwe-917-expression-language-injection skill to secure the provided Java code snippet against expression language injection.

Frequently Asked Questions about cwe-917-expression-language-injection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix CWE-917 Expression Language Injection vulnerabilities in Spring?

To fix Expression Language Injection vulnerabilities in Spring, replace `StandardEvaluationContext` with `SimpleEvaluationContext` and restrict expression parsing to secure dynamic evaluation.

What is Expression Language Injection in Java applications?

Expression Language Injection is a security vulnerability where attackers manipulate dynamic expression evaluation, which is remediated by adopting secure coding practices like using `SimpleEvaluationContext` over `StandardEvaluationContext`.

Why should I use SimpleEvaluationContext instead of StandardEvaluationContext for SpEL?

You should use `SimpleEvaluationContext` instead of `StandardEvaluationContext` to restrict expression parsing capabilities, providing deterministic remediation for CWE-917 and preventing unauthorized code execution.

Can I apply this CWE-917 remediation across controller, service, and repository layers?

Yes, this remediation applies to Spring SpEL usage across controller, service, and repository layers, ensuring secure coding practices for dynamic expression evaluation throughout your Java application architecture.

What should I do when a SAST tool flags an Expression Language Injection vulnerability?

When a SAST tool flags an Expression Language Injection vulnerability, apply this secure coding pattern to replace vulnerable contexts and restrict dynamic expression evaluation in your Spring application.