Skip to content

fix: disable Atmosphere CORS headers on push requests (#26215) (CP: 24.9) - #26290

Merged
vaadin-bot merged 1 commit into
24.9from
cherry-pick-26215-to-24.9-1791543759776
Oct 9, 2026
Merged

vaadin-bot merged 1 commit into
24.9from
cherry-pick-26215-to-24.9-1791543759776

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This PR cherry-picks changes from the original PR #26215 to branch 24.9.


Fixes #26214

Review risk: two-way door. It affects only push requests that carry an Origin header, and the old behavior comes back with one servlet init parameter.

security · flow-server · every app using @Push

Background: Atmosphere CORS. Atmosphere installs a CorsInterceptor by default. For non-WebSocket requests it copies the request's Origin into Access-Control-Allow-Origin, sets Access-Control-Allow-Credentials: true and answers OPTIONS preflights itself.

Push requests no longer send CORS headers. Before this change, any origin was echoed back with credentials allowed.

Risks:

  • Behavior change: cross-origin embedding that uses push over the long-polling fallback now has to answer push OPTIONS preflights in its own CORS filter, or opt back in with the servlet init parameter org.atmosphere.cpr.dropAccessControlAllowOriginHeader=false. WebSocket push is not affected.
  • ✅ No API changes, no migration, no persisted state

Context. The 2015 change meant to disable these headers (vaadin/framework#6109), but it set the parameter to false. That is Atmosphere's default, so the interceptor stayed on.

  • Set DROP_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER to true in PushRequestHandler.initAtmosphere.

Fixes #26214

**Review risk:** two-way door. It affects only push requests that carry
an `Origin` header, and the old behavior comes back with one servlet
init parameter.

**security** · flow-server · every app using `@Push`

**Background: Atmosphere CORS.** Atmosphere installs a `CorsInterceptor`
by default. For non-WebSocket requests it copies the request's `Origin`
into `Access-Control-Allow-Origin`, sets
`Access-Control-Allow-Credentials: true` and answers `OPTIONS`
preflights itself.

Push requests no longer send CORS headers. Before this change, any
origin was echoed back with credentials allowed.

**Risks:**
- Behavior change: cross-origin embedding that uses push over the
long-polling fallback now has to answer push `OPTIONS` preflights in its
own CORS filter, or opt back in with the servlet init parameter
`org.atmosphere.cpr.dropAccessControlAllowOriginHeader=false`. WebSocket
push is not affected.
- ✅ No API changes, no migration, no persisted state

**Context.** The 2015 change meant to disable these headers
(vaadin/framework#6109), but it set the parameter to `false`. That is
Atmosphere's default, so the interceptor stayed on.

- Set `DROP_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER` to `true` in
`PushRequestHandler.initAtmosphere`.

---------

Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
Co-authored-by: Artur Signell <artur@vaadin.com>
Co-authored-by: mikhail <mikhail@vaadin.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the +0.0.1 label Oct 9, 2026
@vaadin-bot

Copy link
Copy Markdown
Collaborator Author

This PR is eligible for auto-merging policy, so it has been approved automatically. If there are pending conditions, auto merge (with 'squash' method) has been enabled for this PR[Message is sent from bot]

@vaadin-bot
vaadin-bot enabled auto-merge (squash) October 9, 2026 11:22
@vaadin-bot

Copy link
Copy Markdown
Collaborator Author

This PR is eligible for auto-merging policy, so it has been approved automatically. If there are pending conditions, auto merge (with 'squash' method) has been enabled for this PR [Message is sent from bot]

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Test Results

1 195 files  ±0  1 195 suites  ±0   1h 2m 42s ⏱️ + 1m 31s
8 971 tests ±0  8 909 ✅ ±0  62 💤 ±0  0 ❌ ±0 
9 213 runs  +2  9 147 ✅ ±0  66 💤 +2  0 ❌ ±0 

Results for commit 6402f73. ± Comparison against base commit 75a04d9.

@vaadin-bot
vaadin-bot merged commit dbe82af into 24.9 Oct 9, 2026
@vaadin-bot
vaadin-bot deleted the cherry-pick-26215-to-24.9-1791543759776 branch October 9, 2026 11:45
@vaadin-bot

Copy link
Copy Markdown
Collaborator Author

This ticket/PR has been released with Vaadin 24.9.24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants