
Félix MalfaitandGitHub
fc6b136c2f
fix: resolve GitHub Actions security vulnerabilities (#16174)
## 🔒 Security Fixes
This PR addresses security vulnerabilities identified by GitHub CodeQL
security scanning.
### Changes
#### 1. Fix Shell Command Injection (High Severity)
**File:** `.github/workflows/docs-i18n-pull.yaml`
**Issue:** Direct interpolation of `${{ github.head_ref }}` in shell
command was susceptible to command injection attacks.
**Fix:** Assign GitHub context variable to environment variable first:
```yaml
run: |
git push origin "HEAD:$HEAD_REF"
env:
HEAD_REF: ${{ github.head_ref }}
```
This prevents malicious input from being executed as shell commands.
#### 2. Add Missing Workflow Permissions (Medium Severity)
**File:** `.github/workflows/ci-test-docker-compose.yaml`
**Issue:** Workflow did not explicitly define GITHUB_TOKEN permissions,
running with overly broad defaults.
**Fix:** Added explicit minimal permissions:
```yaml
permissions:
contents: read
```
This applies to all 3 jobs in the workflow:
- `changed-files-check`
- `test`
- `ci-test-docker-compose-status-check`
### Security Impact
- ✅ Prevents potential shell injection attacks via pull request branch
names
- ✅ Follows principle of least privilege for GitHub Actions tokens
- ✅ Aligns with GitHub Actions security best practices
- ✅ Resolves all CodeQL security alerts for these workflows
### References
- [GitHub Actions: Security hardening for GitHub
Actions](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions)
- [GitHub Actions: Permissions for the
GITHUB_TOKEN](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)
- Related attacks: 2025 Nx supply chain attack, 2024 ultralytics/actions
attack
2025-11-28 13:15:33 +01:00
..
2025-08-18 10:34:12 +02:00
2024-04-01 11:39:04 +02:00
2025-11-28 13:15:33 +01:00
2023-11-13 16:09:59 +01:00
2024-09-12 12:31:34 +02:00
2025-10-31 17:44:14 +01:00
2025-11-20 15:24:26 +01:00
2024-04-15 20:09:06 +02:00
2023-11-07 11:39:29 +01:00