mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
Java: Add a query for SpEL injections
- Added experimental/Security/CWE/CWE-094/SpelInjection.ql and a couple of libraries - Added a qhelp file with a few examples - Added tests and stubs for Spring
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
package org.springframework.expression;
|
||||
|
||||
public interface EvaluationContext {}
|
||||
@@ -0,0 +1,3 @@
|
||||
package org.springframework.expression;
|
||||
|
||||
public class EvaluationException extends RuntimeException {}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.springframework.expression;
|
||||
|
||||
public interface Expression {
|
||||
|
||||
Object getValue() throws EvaluationException;
|
||||
|
||||
Object getValue(EvaluationContext context) throws EvaluationException;
|
||||
|
||||
Class<?> getValueType() throws EvaluationException;
|
||||
|
||||
Class<?> getValueType(EvaluationContext context) throws EvaluationException;
|
||||
|
||||
void setValue(Object rootObject, Object value) throws EvaluationException;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.springframework.expression;
|
||||
|
||||
public interface ExpressionParser {
|
||||
|
||||
Expression parseExpression(String string);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.springframework.expression.spel.standard;
|
||||
|
||||
import org.springframework.expression.*;
|
||||
|
||||
public class SpelExpressionParser implements ExpressionParser {
|
||||
|
||||
public SpelExpressionParser() {}
|
||||
|
||||
public Expression parseExpression(String string) { return null; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
package org.springframework.expression.spel.support;
|
||||
|
||||
import org.springframework.expression.*;
|
||||
|
||||
public class SimpleEvaluationContext implements EvaluationContext {
|
||||
|
||||
public static Builder forReadWriteDataBinding() { return null; }
|
||||
|
||||
public static class Builder {
|
||||
public SimpleEvaluationContext build() { return null; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package org.springframework.expression.spel.support;
|
||||
|
||||
import org.springframework.expression.*;
|
||||
|
||||
public class StandardEvaluationContext implements EvaluationContext {}
|
||||
Reference in New Issue
Block a user