CVE-2024-58354

calcom · cal.diy

A repository takeover vulnerability exists in the cal.diy GitHub Actions workflow, allowing attackers to execute arbitrary code via malicious pull requests and compromise the repository.

Executive summary

A critical repository takeover vulnerability in the cal.diy GitHub Actions workflow enables attackers to execute arbitrary code and gain unauthorized control over the codebase.

Vulnerability

The vulnerability stems from insecure GitHub Actions workflow configurations, specifically the use of pull_request_target combined with dangerous checkout practices. This allows an attacker with low privileges to trigger arbitrary command execution using the repository's write-scoped GITHUB_TOKEN.

Business impact

Exploitation of this flaw allows an attacker to mutate the repository, including pushing malicious code, merging unauthorized pull requests, and modifying branches. This represents a significant supply chain and integrity risk, as it could facilitate the distribution of backdoored software to end users.

Remediation

Immediate Action: Audit and restrict GitHub Actions workflow permissions immediately, ensuring that pull requests from untrusted sources do not have access to repository write tokens.

Proactive Monitoring: Monitor repository audit logs for unauthorized branch mutations, unexpected commits, or suspicious workflow execution activity.

Compensating Controls: Implement mandatory code review processes for all pull requests and utilize branch protection rules to prevent unauthorized merging of code.

Exploitation status

Public Exploit Available: Unknown

Analyst recommendation

While no patched version is currently available, administrators must proactively secure their CI/CD pipelines by hardening workflow permissions. Prioritize reviewing the vendor's security advisory and applying recommended configuration changes to mitigate the risk of repository takeover.