Skip to content

fix(security): replace MD5 with SHA-256 for appstore workdir hashing - #214

Open
ford220102 wants to merge 2 commits into
IceWhaleTech:mainfrom
ford220102:patch-1
Open

ford220102 wants to merge 2 commits into
IceWhaleTech:mainfrom
ford220102:patch-1

Conversation

@ford220102

Copy link
Copy Markdown

Resolves SonarCloud security hotspot go:S4790 (weak hash algorithm).

MD5 was used in WorkDir() only to derive a cache directory name from the appstore URL path - not for any security-sensitive purpose - but using a weak hash still triggers static analysis warnings. Switched to SHA-256 to close the hotspot with no functional changes.

Resolves SonarCloud security hotspot go:S4790 (weak hash algorithm).

MD5 was used in WorkDir() only to derive a cache directory name from
the appstore URL path - not for any security-sensitive purpose - but
using a weak hash still triggers static analysis warnings. Switched
to SHA-256 to close the hotspot with no functional changes.
Resolves SonarCloud reliability bug (http-resource-leak, L83).

http.Head() response body was never closed on the success path,
leaking the underlying connection. Added defer res.Body.Close()
immediately after the error check.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant