hex0punk / wally

Function callpath mapping analysis tool for Go
Mozilla Public License 2.0
28 stars 0 forks source link

Logic fixes #51

Closed hex0punk closed 3 months ago

hex0punk commented 3 months ago

Fixes:

dryrunsecurity[bot] commented 3 months ago

DryRun Security Summary

The pull request focuses on improving the accuracy and handling of call instruction retrieval and call graph analysis within the Navigator and callmapper packages, without introducing any significant security vulnerabilities, but it's important to consider the potential security implications of the overall codebase and how these packages are used within the larger application security tooling or framework.

Expand for full summary
**Summary:** The code changes in this pull request focus on improving the accuracy and handling of call instruction retrieval and call graph analysis within the `Navigator` and `callmapper` packages. While these changes do not directly introduce any significant security vulnerabilities, it's important to consider the potential security implications of the overall codebase and how these packages are used within the larger application security tooling or framework. The changes in the `navigator.go` file aim to enhance the `GetCallInstructionFromSSAFunc` function by relying on the `ast.CallExpr` object instead of the `types.Object` obtained from the `GetObjFromCe` function. This change, along with the updates to the `isMatchingCall` function and the handling of `nil` return values, are intended to improve the accuracy of the call instruction retrieval process. The changes in the `callmapper.go` file address the handling of `nil` function packages in the `callerInPath()` function and improve the formatting of the caller's position. These changes are likely to enhance the accuracy and readability of the call graph analysis performed by the `callmapper` package. While these changes do not directly introduce any security concerns, it's important to review the overall codebase and the intended use case of the `Navigator` and `callmapper` packages to ensure that there are no potential security vulnerabilities or misuse of the application. For example, the use of the `ssa` package and the `callgraph` analysis could potentially be leveraged for security-related tasks, such as identifying potential entry points or analyzing the flow of sensitive data. **Files Changed:** 1. `navigator/navigator.go`: - The `GetCallInstructionFromSSAFunc` function no longer takes the `info *types.Info` parameter and instead relies on the `ast.CallExpr` object to find the matching `ssa.CallInstruction`. - The `isMatchingCall` function has been updated to check the position of the `ssa.CallInstruction` against the position of the `ast.CallExpr` object. - The changes in the `Run` function handle the case where the `GetCallInstructionFromSSAFunc` function returns `nil`. 2. `wallylib/callmapper/callmapper.go`: - The `callerInPath()` function now handles the case where the caller's function package is `nil` by assuming that the caller is in the path and returning `true`. - The `callerInPath()` function now uses the `wallylib.GetFormattedPos()` function to get a formatted position string for the caller's function package and site.

Code Analysis

We ran 9 analyzers against 2 files and 0 analyzers had findings. 9 analyzers had no findings.

Riskiness

:green_circle: Risk threshold not exceeded.

View PR in the DryRun Dashboard.