CVE-2023-6022

8.8 HIGH

📋 TL;DR

This Cross-Site Request Forgery (CSRF) vulnerability in Prefect allows attackers to trick authenticated users into performing unintended actions on their behalf. It affects users of Prefect versions prior to 2.16.5 who have authenticated sessions. The vulnerability could lead to unauthorized workflow modifications or data access.

💻 Affected Systems

Products:
  • Prefect
Versions: All versions prior to 2.16.5
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects Prefect deployments with web UI accessible to users. Requires user authentication to be exploitable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could modify or delete workflows, access sensitive data, or disrupt workflow orchestration by tricking authenticated administrators into executing malicious requests.

🟠

Likely Case

Attackers could manipulate workflow configurations, trigger unauthorized workflow runs, or access workflow metadata through crafted CSRF attacks.

🟢

If Mitigated

With proper CSRF protections and user awareness, impact is limited to unsuccessful attack attempts with no actual compromise.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

CSRF attacks typically require user interaction (clicking malicious link) but are straightforward to execute once crafted.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.16.5

Vendor Advisory: https://github.com/prefecthq/prefect/commit/227dfcc7e3374c212a4bcd68b14e090b1c02d9d3

Restart Required: Yes

Instructions:

1. Update Prefect to version 2.16.5 or later using pip: pip install --upgrade prefect==2.16.5
2. Restart all Prefect services
3. Verify the update with: prefect version

🔧 Temporary Workarounds

CSRF Token Implementation

all

Manually implement CSRF tokens if unable to patch immediately

SameSite Cookie Enforcement

all

Configure cookies with SameSite=Strict attribute

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to detect CSRF patterns
  • Educate users about phishing risks and require re-authentication for sensitive actions

🔍 How to Verify

Check if Vulnerable:

Check Prefect version with: prefect version. If version is below 2.16.5, system is vulnerable.

Check Version:

prefect version

Verify Fix Applied:

Verify version is 2.16.5 or higher with: prefect version. Test CSRF protection by attempting to submit forms without valid tokens.

📡 Detection & Monitoring

Log Indicators:

  • Failed CSRF token validation attempts
  • Unusual workflow modifications from unexpected sources
  • Multiple failed authentication attempts followed by successful requests

Network Indicators:

  • Requests missing CSRF tokens
  • Requests with mismatched referer headers
  • Suspicious cross-origin requests to Prefect endpoints

SIEM Query:

source="prefect" AND ("CSRF" OR "token validation failed")

🔗 References

📤 Share & Export