You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this method initialize the resultSet variable with null value and only assign any value to it inside ta try-catch block. But before assigning any value to resultSet if IOException occurs due to readOutput or Runtime.getRuntime().exec() then resultSet will be returned as null which can later lead to NullPointerException in the very first method due to null.map(mapper)
Possible Workaround
One possible workaround is always check the returned value of execute() like
as the executeCommand method was used in the several places in the codebase so, if any of the places this scenario arises which can lead to an unexpected behavior or crash the program.
Fix from triage team!!!
We have mentioned to return something appropriate because of lack of knowledge of the codebase, it is not possible to know which value should be the appropriate value to return in case of any null vlaue or which fix type is more appropriate for this codebase.
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 iCR tool by OpenRefactory, Inc. and then manually triaging the results.
The text was updated successfully, but these errors were encountered:
Potential Null Dereference Path
In file: CommandShellExecutor.java there is the following code segment
which invokes another method
executeCommand
which invokes
execute
this method initialize the
resultSet
variable with null value and only assign any value to it inside tatry-catch
block. But before assigning any value to resultSet ifIOException
occurs due toreadOutput
orRuntime.getRuntime().exec()
then resultSet will be returned asnull
which can later lead toNullPointerException
in the very first method due tonull.map(mapper)
Possible Workaround
One possible workaround is always check the returned value of
execute()
likeanother workaround can be
use of try-catch
which is generally not recommended as a best practiceas the
executeCommand
method was used in the several places in the codebase so, if any of the places this scenario arises which can lead to an unexpected behavior or crash the program.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 iCR tool by OpenRefactory, Inc. and then manually triaging the results.
The text was updated successfully, but these errors were encountered: