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

Potential Null Pointer Dereference #907

Open
rng70-or opened this issue May 28, 2024 · 0 comments
Open

Potential Null Pointer Dereference #907

rng70-or opened this issue May 28, 2024 · 0 comments
Labels

Comments

@rng70-or
Copy link

In file: AsyncInternal.java, class AsyncInternal method isAsync, there is a potential Null pointer dereference. This may throw an unexpected null pointer exception which, if unhandled, may crash the program.

public static boolean isAsync(Object func) {
    SerializedLambda lambda = LambdaUtils.toSerializedLambda(func);
    Object target = getTarget(lambda);
    return target instanceof ActivityStub
        || target instanceof ChildWorkflowStub
        || target instanceof ExternalWorkflowStub
        || (target instanceof AsyncMarker
            && lambda.getImplMethodKind() == MethodHandleInfo.REF_invokeInterface);
  }

variable labmda may initialized with null and if so, then, lambda.getImplMethodKind() will raise a null pointer exception. A null check should be introduced to avoid unexpected null pointer exceptions.

Sponsorship and Support

This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF): Project Alpha-Omega. Alpha-Omega is a project partnering with open source software project maintainers to systematically find new, as-yet-undiscovered vulnerabilities in open source code - and get them fixed – to improve global software supply chain security.

The bug is found by running the Intelligent Code Repair (iCR) tool by OpenRefactory and then manually triaging the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants