hex0punk / wally

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

better handling of nested closures for strict limiter mode #56

Closed hex0punk closed 3 months ago

dryrunsecurity[bot] commented 3 months ago

DryRun Security Summary

The pull request focuses on improving the functionality and accuracy of the CallMapper struct in the wallylib/callmapper/callmapper.go file, including handling closures, updating the appendNodeToPath and appendInterToPath functions, and enhancing the handling of the Limiter option in the BFS function.

Expand for full summary
**Summary:** The code changes in this pull request focus on improving the functionality and accuracy of the `CallMapper` struct in the `wallylib/callmapper/callmapper.go` file. The primary changes include: 1. Introducing a dedicated `handleClosure` function to properly handle cases where a function node in the call graph is a closure. This ensures that the call path includes the enclosing function. 2. Updating the `appendNodeToPath` and `appendInterToPath` functions to handle cases where the function package is `nil` or the `PrintNodes` option is enabled. 3. Enhancing the handling of the `Limiter` option in the `BFS` function to correctly filter out calls that go outside the main package. From an application security perspective, these changes do not directly introduce any security vulnerabilities. However, the improvements to the handling of closures and the `Limiter` functionality can have a positive impact on the overall security analysis performed by the `CallMapper`. Accurately tracking and analyzing call paths, including those involving closures, can help identify potential security issues related to improper input validation, privilege escalation, and denial of service vulnerabilities. **Files Changed:** - `wallylib/callmapper/callmapper.go`: The changes in this file focus on improving the functionality and accuracy of the `CallMapper` struct. The key changes include: - Introduction of a `handleClosure` function to properly handle cases where a function node in the call graph is a closure. - Updates to the `appendNodeToPath` and `appendInterToPath` functions to handle cases where the function package is `nil` or the `PrintNodes` option is enabled. - Enhancements to the handling of the `Limiter` option in the `BFS` function to correctly filter out calls that go outside the main package.

Code Analysis

We ran 9 analyzers against 1 file and 0 analyzers had findings. 9 analyzers had no findings.

Riskiness

:green_circle: Risk threshold not exceeded.

View PR in the DryRun Dashboard.