Fix CORS Misconfiguration - Use Specific Origins Instead of Wildcard#359
Open
grich88 wants to merge 1 commit intoAIxBlock-2023:mainfrom
Open
Fix CORS Misconfiguration - Use Specific Origins Instead of Wildcard#359grich88 wants to merge 1 commit intoAIxBlock-2023:mainfrom
grich88 wants to merge 1 commit intoAIxBlock-2023:mainfrom
Conversation
Author
|
This PR fixes Issue #356 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #1: Fix CORS Misconfiguration - Use Specific Origins Instead of Wildcard
Fixes #356
🔧 FIX: CORS MISCONFIGURATION
Related Issue: #356 (CORS Misconfiguration)
Severity: High (CVSS 7.5)
File Changed:
workflow/packages/backend/api/src/app/server.ts📋 SUMMARY
This PR fixes a critical CORS misconfiguration that allowed any origin to read authenticated responses, enabling cross-site data theft from authenticated users' sessions.
Vulnerability:
Access-Control-Allow-Origin: *(wildcard) combined withAccess-Control-Allow-Credentials: trueFix: Use specific allowed origins instead of wildcard
🔍 CHANGES
Before (Vulnerable):
After (Fixed):
✅ WHAT THIS FIX DOES
ALLOWED_ORIGINSenvironment variable🧪 TESTING
Test 1: Legitimate Origin (Should Work)
Expected:
Access-Control-Allow-Origin: https://app.aixblock.ioTest 2: Malicious Origin (Should Be Blocked)
Expected: CORS error or no
Access-Control-Allow-OriginheaderTest 3: No Origin (Should Work)
curl -X GET "https://workflow.aixblock.io/api/workflows/" \ -vExpected: Request succeeds (no origin check)
🔐 SECURITY IMPACT
📝 ENVIRONMENT VARIABLES
To add additional allowed origins, set the
ALLOWED_ORIGINSenvironment variable:✅ VERIFICATION CHECKLIST
Status: Ready for Review
Date: 2025-11-11