{"record":{"id":"19982f3e506c808f","repo":"frohoff/ysoserial","slug":"invalid-el-type-system-getproperty-el","errorCode":null,"errorMessage":"Invalid el type ${System.getProperty(\"el\")}","messagePattern":"Invalid el type (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/ysoserial/payloads/Myfaces1.java","lineNumber":73,"sourceCode":"                \"org.apache.myfaces.core:myfaces-impl:2.2.9\", \"org.apache.myfaces.core:myfaces-api:2.2.9\",\n                \"org.mortbay.jasper:apache-el:8.0.27\",\n                \"javax.servlet:javax.servlet-api:3.1.0\",\n\n                // deps for mocking the FacesContext\n                \"org.mockito:mockito-core:1.10.19\", \"org.hamcrest:hamcrest-core:1.1\", \"org.objenesis:objenesis:2.1\"\n            };\n        } else if ( \"juel\".equals(System.getProperty(\"el\")) ) {\n            return new String[] {\n                \"org.apache.myfaces.core:myfaces-impl:2.2.9\", \"org.apache.myfaces.core:myfaces-api:2.2.9\",\n                \"de.odysseus.juel:juel-impl:2.2.7\", \"de.odysseus.juel:juel-api:2.2.7\",\n                \"javax.servlet:javax.servlet-api:3.1.0\",\n\n                // deps for mocking the FacesContext\n                \"org.mockito:mockito-core:1.10.19\", \"org.hamcrest:hamcrest-core:1.1\", \"org.objenesis:objenesis:2.1\"\n            };\n        }\n\n        throw new IllegalArgumentException(\"Invalid el type \" + System.getProperty(\"el\"));\n    }\n\n    public static Object makeExpressionPayload ( String expr ) throws IllegalArgumentException, IllegalAccessException, Exception  {\n        FacesContextImpl fc = new FacesContextImpl((ServletContext) null, (ServletRequest) null, (ServletResponse) null);\n        ELContext elContext = new FacesELContext(new CompositeELResolver(), fc);\n        Reflections.getField(FacesContextImplBase.class, \"_elContext\").set(fc, elContext);\n        ExpressionFactory expressionFactory = ExpressionFactory.newInstance();\n\n        ValueExpression ve1 = expressionFactory.createValueExpression(elContext, expr, Object.class);\n        ValueExpressionMethodExpression e = new ValueExpressionMethodExpression(ve1);\n        ValueExpression ve2 = expressionFactory.createValueExpression(elContext, \"${true}\", Object.class);\n        ValueExpressionMethodExpression e2 = new ValueExpressionMethodExpression(ve2);\n\n        return Gadgets.makeMap(e2, e);\n    }\n\n\n    public static void main ( final String[] args ) throws Exception {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/frohoff/ysoserial/blob/218bcffcaaa904a4e392f0c15d9e2874533635a3/src/main/java/ysoserial/payloads/Myfaces1.java#L55-L91","documentation":"Myfaces1 supports multiple EL expression payload types selected via the 'el' system property; getDependencies() returns the matching dependency set only for known values, otherwise it throws IllegalArgumentException listing the current value of System.getProperty(\"el\").","triggerScenarios":"Running with -Del=<unrecognized value> (or not setting 'el' when the code path expects it) so getDependencies() falls through all known el-type branches and hits the throw.","commonSituations":"Typo in the el property value; switching Myfaces1 variants between JDK7/8 EL implementations and keeping the old -Del flag; forgetting the flag entirely.","solutions":["Set a supported value: -Del=jsf (or the exact values accepted in Myfaces1 source, e.g. matching the EL classes on the classpath)","Read Myfaces1.java to see the recognized el type strings and their required dependencies","Add the matching EL/JSP API dependencies for the chosen el type"],"exampleFix":"// before\njava -Del=el22 -jar ysoserial.jar Myfaces1 \"...\"\n// after\njava -Del=jsf -jar ysoserial.jar Myfaces1 \"...\"","handlingStrategy":"validation","validationCode":"String el = System.getProperty(\"el\"); if (!Set.of(\"jsf\",\"spring\",\"jsf52\").contains(el)) throw new IllegalArgumentException(\"unsupported el type: \" + el);","typeGuard":null,"tryCatchPattern":"try { deps = new Myfaces1().getDependencies(); } catch (IllegalArgumentException e) { printValidElTypes(); }","preventionTips":["Set -Del to a value accepted by the Myfaces1 source","Match the el type to the EL API on the classpath","Update the flag when switching JDK/target versions"],"tags":["ysoserial","myfaces","config","el"],"backgroundTag":"invalid-config-value","analyzedSha":"218bcffcaaa904a4e392f0c15d9e2874533635a3","analyzedAt":"2026-09-12T01:53:58.488Z","contentChangedAt":"2026-09-12T01:53:58.488Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}