Skip to content

fix: resolve all security scan findings (3 HIGH, 4 MEDIUM)#3

Merged
KhaledSalhab-Develeap merged 3 commits into
mainfrom
fix/security-scan-findings
Apr 5, 2026
Merged

fix: resolve all security scan findings (3 HIGH, 4 MEDIUM)#3
KhaledSalhab-Develeap merged 3 commits into
mainfrom
fix/security-scan-findings

Conversation

@KhaledSalhab-Develeap
Copy link
Copy Markdown
Collaborator

Summary

Fixes all 7 actionable findings from the security vulnerability scan.

HIGH (3)

  • Retry-After header crash: float() on the raw Retry-After header value was unguarded. RFC 7231 allows HTTP-date strings (e.g., "Fri, 31 Dec 2025 23:59:59 GMT"), which would throw ValueError and crash the retry loop. Now wrapped in try/except, falling back to exponential backoff.
  • GitHub Actions pinned to commit SHAs (H11): All 6 action references across both workflows are now pinned to full 40-char SHAs instead of mutable tags, closing the supply chain vector.
  • Publish audit step now blocking: Removed continue-on-error: true from publish.yml so vulnerable dependencies cannot ship to PyPI. CI workflow audit stays soft to avoid blocking development.

MEDIUM (4)

  • Log sanitization: Removed raw API response dicts from parse_list warning logs to prevent leaking subscriber emails or custom auth headers.
  • API key validation: HyperpingClient(api_key="") now raises ValueError immediately instead of producing confusing 401 errors.
  • .gitignore hardened: Added .env, .env.*, .env.local exclusions.
  • get_headers_dict() documented: Added warning that returned dict may contain sensitive values (e.g., Authorization tokens configured on monitors).

Test plan

  • ruff check src tests - All checks passed
  • mypy src - 0 errors in 19 files
  • pytest - 177 passed, 91.5% coverage (threshold 85%)

HIGH:
- Guard float() on Retry-After header with try/except to handle
  RFC 7231 HTTP-date values without crashing the retry loop
- Pin all GitHub Actions to full 40-char commit SHAs (H11):
  actions/checkout, astral-sh/setup-uv, codecov/codecov-action,
  actions/upload-artifact, actions/download-artifact,
  pypa/gh-action-pypi-publish
- Make publish workflow audit step blocking (no continue-on-error);
  CI audit stays soft to avoid blocking development

MEDIUM:
- Remove raw API response data from parse_list warning logs to
  prevent leaking subscriber emails or custom auth headers
- Validate API key is non-empty on HyperpingClient init
- Add .env / .env.* / .env.local to .gitignore
- Document get_headers_dict() may return sensitive header values
- Add pip-audit>=2.7 to dev dependencies so CI audit step works
  without fallbacks; simplify audit commands in both workflows
- Add .github/dependabot.yml to auto-update pinned Action SHAs
  (weekly) and Python dependency lockfile (weekly)
- Add SLSA build provenance attestation to publish workflow using
  actions/attest-build-provenance@v2 (pinned to commit SHA);
  build job now has attestations: write permission
@KhaledSalhab-Develeap KhaledSalhab-Develeap merged commit 45fcb95 into main Apr 5, 2026
4 checks passed
@KhaledSalhab-Develeap KhaledSalhab-Develeap deleted the fix/security-scan-findings branch April 9, 2026 06:15
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