Problem
Both config.yml and config-testing.yml set cors.allowed_origins to [*]:
# api/config/config.yml:39-41
cors:
allowed_origins:
- *
This means any origin can make authenticated cross-origin requests to the chatbot API. A malicious page on any domain can hit every endpoint - start sessions, post messages, upload files, stream WebSocket responses - without the browser blocking anything.
Impact
- CSRF-style attacks: a user visits a malicious page while logged into Jenkins, that page silently calls the chatbot API in the user's browser context
- Data exfiltration: the malicious page reads chat history, session data, or streamed LLM responses
- This is a textbook OWASP misconfiguration (A05:2021 Security Misconfiguration)
Proposed Fix
- Remove the wildcard and restrict to the Jenkins instance origin
- Read allowed origins from an environment variable so deployment-specific values don't require config file changes
cors:
allowed_origins:
- ${CORS_ALLOWED_ORIGIN:-http://localhost:8080}
- Update
config-testing.yml to use http://localhost or http://testserver (the FastAPI test client origin)
- Add a startup log line printing the active CORS origins for visibility
Acceptance Criteria
References
Problem
Both
config.ymlandconfig-testing.ymlsetcors.allowed_originsto[*]:This means any origin can make authenticated cross-origin requests to the chatbot API. A malicious page on any domain can hit every endpoint - start sessions, post messages, upload files, stream WebSocket responses - without the browser blocking anything.
Impact
Proposed Fix
config-testing.ymlto usehttp://localhostorhttp://testserver(the FastAPI test client origin)Acceptance Criteria
config.ymlno longer contains*as an allowed originconfig-testing.ymluses a test-appropriate origin, not wildcardTestClientorigin header adjustments)localhost:5173(Vite dev server) still worksReferences
chatbot-core/api/config/config.ymllines 39-41chatbot-core/api/config/config-testing.ymllines 39-41chatbot-core/api/main.py(whereCORSMiddlewareis added)