[APPSEC-1645] [Non-Prod] Add Socket Security Tier 1 reachability scan#105
[APPSEC-1645] [Non-Prod] Add Socket Security Tier 1 reachability scan#105ping-huang1 wants to merge 1 commit intomainfrom
Conversation
Adds a GitHub Actions workflow for Socket Security scanning with Tier 1 reachability analysis to identify which dependency vulnerabilities are actually reachable in the codebase. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
| node-version: "20" | ||
|
|
||
| - name: Install uv (Python package manager) | ||
| uses: astral-sh/setup-uv@v4 |
There was a problem hiding this comment.
Semgrep identified an issue in your code:
The GitHub action astral-sh/setup-uv@v4 uses a mutable version tag that could be rewritten by an attacker to inject malicious code into your workflow.
More details about this
The astral-sh/setup-uv@v4 action is pinned to a version tag instead of a full commit SHA. Version tags in GitHub are mutable—a maintainer can move or re-tag a release at any time. An attacker who compromises the astral-sh/setup-uv repository could overwrite the v4 tag to point to malicious code.
Exploit scenario:
- An attacker compromises the
astral-sh/setup-uvrepository and gains push access - They force-push a commit containing a backdoor to rewrite the
v4tag - Your workflow runs and pulls the malicious code via
uses: astral-sh/setup-uv@v4 - The backdoor executes in the runner environment with access to
secrets.SOCKET_SECURITY_API_KEYand your repository code - The attacker exfiltrates credentials and source code
Pinning to a specific commit SHA (e.g., @a1b2c3d4e5f6...) creates an immutable reference that cannot be altered after commit creation, even if the tag is rewritten.
To resolve this comment:
✨ Commit Assistant fix suggestion
| uses: astral-sh/setup-uv@v4 | |
| # Pinned to v4 for security; see https://github.com/astral-sh/setup-uv/tags | |
| uses: astral-sh/setup-uv@ed597411d8f924073f98dfc5c65a23a2325f34cd |
View step-by-step instructions
- Replace the action version in
uses: astral-sh/setup-uv@v4with a full 40-character commit SHA from the official setup-uv repository. For example:uses: astral-sh/setup-uv@ed597411d8f924073f98dfc5c65a23a2325f34cd - (Optional but recommended) Add a comment with the pinned SHA to indicate why it's pinned and provide a link to the action/tag for reference, e.g.
# Pinned to v4 for security; see https://github.com/astral-sh/setup-uv/tags
Pinning to a commit SHA makes the workflow more secure and prevents unexpected changes if the upstream action is updated.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by third-party-action-not-pinned-to-commit-sha.
You can view more details about this finding in the Semgrep AppSec Platform.
zmcnellis
left a comment
There was a problem hiding this comment.
@ping-huang1 I think my team (developer platform) was incorrectly tagged on this PR. Maybe you meant delivery loop?
| - name: Run Socket Security Scan | ||
| env: | ||
| SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_SECURITY_API_KEY }} | ||
| SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_KEY }} |
There was a problem hiding this comment.
I don't have context on this PR, but at a glance this seems redundant to have SOCKET_SECURITY_API_KEY and SOCKET_SECURITY_API_TOKEN pointed to the same secret?
Summary
Details
The workflow:
uvsocketcliwith Tier 1 reachability flags (--reach --reach-memory-limit 16384 --reach-timeout 3600)Required secret:
SOCKET_SECURITY_API_KEY(enterprise plan) with scopes:socket-basics,uploaded-artifacts,full-scans,repoTest plan
https://webflow.atlassian.net/browse/APPSEC-1645