Visitar URL original
There is a script injection here, but codeql can't detect it · Issue #12472 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20260810094008/https://github.com/github/codeql/issues/12472
Skip to content

There is a script injection here, but codeql can't detect it #12472

Description

@jiemodesehn

There is a script injection here, but codeql can't detect it, it may be a source problemDescription of the false positive

Code samples or links to source code

For closed source code: (redacted) code samples that illustrate the problem, for example:

public AccessResult addHtmlTemplate(@RequestBody TemplateBean template) {
        params = template.getParams();
        map = (Map)this.objectMapper.readValue(params.getExtensionParam(), Map.class);
        String newExpression = ((String)map.get("expression"))
        ScriptEngineManager engineManager = new ScriptEngineManager();
        ScriptEngine engine = engineManager.getEngineByName("javascript");

        try {
            Object eval = engine.eval(newExpression);
            if (eval != null) {
                return true;
            }
        } catch (Exception var5) {
            var5.printStackTrace();
        }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions