Closed jkrech closed 1 week ago
@bgn42 could you add a test for a pack file that uses ..
as file reference to get the coverage up if you think this is useful.
Code Climate has analyzed commit 42765eda and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 100.0% (50% is the threshold).
This pull request will bring the total coverage in the repository to 59.8% (0.0% change).
View more on Code Climate.
Fixes https://github.com/Open-CMSIS-Pack/cpackget/security/code-scanning/49
To fix the problem, we need to ensure that the file paths extracted from the zip archive do not contain any directory traversal sequences like
..
. This can be done by adding a check to ensure that the file paths are safe before using them in file operations...
before using them.validate
method incmd/installer/pack.go
to include this check.utils.SecureInflateFile
function is only called with sanitized paths.Suggested fixes powered by Copilot Autofix. Review carefully before merging.