Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新版本 ognl 有一个 UseStricterInvocation 模块,默认开启,执行 ognl 表达式容易出现: cannot be called from within OGNL invokeMethod() under stricter invocation mode #2955

Open
hengyunabc opened this issue Nov 21, 2024 · 0 comments
Milestone

Comments

@hengyunabc
Copy link
Collaborator

$ ognl '@java.lang.ClassLoader@getSystemClassLoader().loadClass("aaa")'
Failed to execute ognl, exception message: ognl.MethodFailedException: Method "getSystemClassLoader" failed for object class java.lang.ClassLoader [java.lang.IllegalAccessException: Method [public static java.lang.ClassLoader java.lang.ClassLoader.getSystemClassLoader()] cannot be called from within OGNL invokeMethod() under stricter invocation mode.], please check $HOME/logs/arthas/arthas.log for more details.
    /**
     * Control usage of "stricter" invocation processing by invokeMethod() using the JVM options:
     * -Dognl.UseStricterInvocation=true
     * -Dognl.UseStricterInvocation=false
     * <p>
     * Note: Using the "true" value has the same effect as omitting the option completely.
     * The default behaviour is to use the "stricter" invocation processing.
     * Using the "false" value reverts to the older "less strict" invocation processing
     * (in the event the "stricter" processing causes issues for existing applications).
     */
    static final String USE_STRICTER_INVOCATION = "ognl.UseStricterInvocation";

需要和 arthas 本身的 options strict 对应起来。

@hengyunabc hengyunabc added this to the 4.0.5 milestone Nov 21, 2024
hengyunabc added a commit that referenced this issue Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant