Skip to content

2.46.2

Latest

Choose a tag to compare

@fescobar fescobar released this 01 Dec 22:25
9da38cb

Security Fix: Cross-Origin Credentialed Reads via Permissive CORS (CWE-942)

Available from Allure Docker Service version 2.46.2

Summary

In previous versions of allure-docker-service, the API reflected any Origin header alongside Access-Control-Allow-Credentials: true and did not set a SameSite attribute on authentication cookies. When SECURITY_ENABLED=1 was used, another web app on the same site (for example, a different port or sibling subdomain) could make credentialed GET requests on a logged-in user's behalf and read protected project and report data.

What Changed

  • CORS is now deny-by-default: Cross-origin credentialed headers (Access-Control-Allow-Origin and Access-Control-Allow-Credentials: true) are no longer returned unless the request Origin matches the new CORS_ALLOWED_ORIGINS environment variable.
  • Explicit SameSite cookie policy: Authentication cookies now default to SameSite=Lax (configurable via JWT_COOKIE_SAMESITE).

Impact on Your Setup

Deployment / Client Type Action Needed? Impact
Non-browser clients (curl, CI/CD scripts, test runners) None Works as before. Browsers only enforce CORS.
Built-in Swagger UI None Works as before (same-origin).
API + UI behind a reverse proxy on the same origin (same scheme, host, and port) None Works as before (same-origin).
allure-docker-service-ui or custom UI on a different origin/port (e.g., http://localhost:7474 calling http://localhost:5050) Set CORS_ALLOWED_ORIGINS Browser requests will be blocked until you add CORS_ALLOWED_ORIGINS=<your-ui-origin> (comma-separated for multiple origins) to allure-docker-service.

Example Configuration (Cross-Origin UI)

environment:
  CORS_ALLOWED_ORIGINS: "http://localhost:7474,https://allure-ui.example.com"

Troubleshooting

If you upgrade and see "Network Error" ("Check if you have access to ...") in allure-docker-service-ui—or "Provisional headers are shown" / a CORS error in your browser's DevTools Network tab—your UI is running on a different origin (scheme, domain, or port) than the API.

To fix it, set CORS_ALLOWED_ORIGINS on the allure-docker-service container to the exact origin shown in your browser's address bar (for example, http://localhost:7474 without a trailing slash) and restart the container.

Acknowledgments

Thanks to Yeting Li, Institute of Information Engineering, Chinese Academy of Sciences (https://yetingli.github.io/) for responsibly reporting this issue.