CVE-2024-42370

8.3 HIGH

📋 TL;DR

This CVE describes an environment variable injection vulnerability in Litestar's GitHub Actions workflow that could allow attackers to exfiltration secrets and manipulate repositories. It affects Litestar versions 2.10.0 and prior. The vulnerability exposes the DOCS_PREVIEW_DEPLOY_TOKEN and grants unauthorized write access to issues and pull requests.

💻 Affected Systems

Products:
  • Litestar
Versions: 2.10.0 and prior
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using the vulnerable GitHub Actions workflow file (.github/workflows/docs-preview.yml)

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete repository takeover, secret exfiltration, unauthorized code changes, and potential supply chain compromise through malicious pull requests.

🟠

Likely Case

Unauthorized access to repository secrets, creation of malicious issues/pull requests, and potential credential theft from exposed tokens.

🟢

If Mitigated

Limited to repository metadata exposure if proper access controls and secret management are implemented.

🌐 Internet-Facing: HIGH
🏢 Internal Only: LOW

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires access to trigger GitHub Actions workflows, typically through repository access or pull requests.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in commit 84d351e96aaa2a1338006d6e7221eded161f517b

Vendor Advisory: https://github.com/litestar-org/litestar/security/advisories/GHSA-4hq2-rpgc-r8r7

Restart Required: No

Instructions:

1. Update to Litestar version after commit 84d351e96aaa2a1338006d6e7221eded161f517b
2. Replace vulnerable .github/workflows/docs-preview.yml with patched version
3. Rotate any exposed DOCS_PREVIEW_DEPLOY_TOKEN and other repository secrets

🔧 Temporary Workarounds

Disable vulnerable workflow

all

Temporarily disable the docs-preview.yml GitHub Actions workflow

Navigate to repository Settings > Actions > Workflow permissions > Disable workflow for .github/workflows/docs-preview.yml

Restrict workflow permissions

all

Limit GitHub Actions permissions to read-only where possible

Set repository Settings > Actions > General > Workflow permissions to 'Read repository contents permission'

🧯 If You Can't Patch

  • Rotate all repository secrets and access tokens immediately
  • Implement strict code review requirements for all pull requests and workflow changes

🔍 How to Verify

Check if Vulnerable:

Check if .github/workflows/docs-preview.yml contains vulnerable environment variable usage patterns from pre-patch versions

Check Version:

Check Litestar version with: pip show litestar | grep Version

Verify Fix Applied:

Verify workflow file matches patched version from commit 84d351e96aaa2a1338006d6e7221eded161f517b

📡 Detection & Monitoring

Log Indicators:

  • Unauthorized workflow executions
  • Unexpected secret usage in GitHub Actions logs
  • Suspicious pull request or issue creation

Network Indicators:

  • Unexpected outbound connections from GitHub Actions runners
  • Unusual API calls to repository endpoints

SIEM Query:

source="github-actions" AND (event="workflow_run" OR event="pull_request") AND action="completed" AND suspicious_patterns

🔗 References

📤 Share & Export