Argo CD, Race Condition Denial-of-Service, CVE-2022-31118 (Critical)

Listen to this Post

How the CVE Works

The vulnerability exists in the `util/db/repository_secrets.go` file, specifically within functions like secretToRepoCred. A race condition occurs when concurrent operations, such as creating, updating, or deleting repository credentials targeting the same repository URL, are executed. These operations are often triggered by Kubernetes informer re-syncs or background watchers. The code accesses a shared map structure without mutex protection. This leads to a “concurrent map read and map write” panic, as one goroutine attempts to write to the map while another is reading from it. This panic crashes the entire Argo CD server process, causing a complete denial-of-service. An attacker needs a valid API token with permissions for repository actions to trigger this race condition repeatedly.

DailyCVE Form

Platform: Argo CD
Version: >= v2.1.0
Vulnerability: Race Condition
Severity: Critical

date: 2022-07-XX

Prediction: Patch expected July 2022

What Undercode Say:

Analytics

grep -n "secretToRepoCred" util/db/repository_secrets.go
go test -race ./util/db/...
// Vulnerable code pattern
func (s secretsRepositoryBackend) secretToRepoCred(secret v1.Secret) {
// Direct access to map 's.creds' without a lock
creds := s.creds[secret.UID]
}
// Fixed code uses deep copy
newSecret := secret.DeepCopy()

How Exploit:

1. Acquire API token.

2. Concurrently call repository credential endpoints.

3. Target the same repository URL.

4. Trigger map read/write collision.

5. Crash Argo CD server.

Protection from this CVE

Upgrade Argo CD.

Implement network policies.

Use least-privilege tokens.

Impact:

Full server unavailability.

Disrupted GitOps workflows.

Sustained Denial-of-Service.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top