PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-40316 OWASP-BLT CVE debrief

CVE-2026-40316 describes a high-severity remote code execution issue in OWASP BLT’s .github/workflows/regenerate-migrations.yml workflow. The workflow is triggered with pull_request_target, runs with write-capable GITHUB_TOKEN permissions, and copies attacker-controlled content from an untrusted pull request into the trusted runner workspace before invoking Django migration generation. Because makemigrations imports model modules at runtime, module-level code in an attacker-supplied website/models.py can execute inside the privileged CI environment. The practical risk is secret exposure, repository compromise, and downstream supply-chain abuse if a maintainer applies the regenerate-migrations label to a malicious pull request.

Vendor
OWASP-BLT
Product
BLT
CVSS
HIGH 8.8
CISA KEV
Not listed in stored evidence
Original CVE published
2026-04-15
Original CVE updated
2026-05-21
Advisory published
2026-04-15
Advisory updated
2026-05-21

Who should care

OWASP BLT maintainers, GitHub Actions and CI/CD administrators, release engineers, and any team consuming or forking the affected workflow pattern should treat this as urgent. External contributors can only trigger the path through a maintainer-applied label, so the main exposure is to repositories that rely on that workflow and accept labeled pull requests.

Technical summary

According to the supplied advisory description and NVD metadata, the vulnerable workflow uses pull_request_target, which executes in the context of the base repository and grants full GITHUB_TOKEN write permissions. The job then pulls attacker-controlled files from the PR into the runner workspace via git show and runs python manage.py makemigrations. Django’s migration generation imports model modules, so malicious top-level Python code in a PR-controlled models.py is executed during import. This creates a CI-side RCE condition with access to repository secrets and write permissions. The NVD record maps the issue to CWE-94 and CWE-95.

Defensive priority

High. The issue directly impacts CI trust boundaries and can lead to secret leakage or repository takeover from a single malicious pull request when labeled by a maintainer.

Recommended defensive actions

  • Upgrade OWASP BLT to a fixed release once 2.1.1 is available or later.
  • Review and restrict use of pull_request_target in repository workflows, especially for jobs that touch untrusted PR content.
  • Avoid executing project code from untrusted pull requests in privileged CI contexts; use isolated, read-only validation jobs instead.
  • Do not copy attacker-controlled files into a trusted workspace before running commands that import application modules.
  • Limit workflow permissions and repository secrets exposure to the minimum required for each job.
  • Require stronger approval controls for any label or automation that can launch privileged CI.
  • Audit recent pull requests and workflow runs for suspicious behavior if the vulnerable workflow was enabled.

Evidence notes

The supplied source corpus states that versions prior to 2.1.1 are affected and that the issue exists in .github/workflows/regenerate-migrations.yml. NVD metadata for this CVE lists the vulnerable CPE as owasp_blt with an end-inclusive version of 2.1, which is slightly different from the advisory wording; that discrepancy is noted here rather than resolved beyond the provided evidence. The CVE was published on 2026-04-15T23:16:10.220Z and last modified on 2026-05-21T19:25:30.010Z. Official references supplied include the CVE record, NVD detail page, and the GitHub Security Advisory.

Official resources

Publicly disclosed on 2026-04-15 and last updated on 2026-05-21. The supplied advisory text indicates a patch is expected in version 2.1.1.