You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/foundations/upgrade-to-v9.adoc
+64Lines changed: 64 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,8 @@ This page summarizes the new features and provides guidance on upgrading from pr
31
31
|Migrated from `AsyncLoadingCache` to `LoadingCache` for improved performance and reduced overhead
32
32
|GraalVM Native Image Support
33
33
|RESTHeart officially listed as framework tested with GraalVM native image
34
+
|Optimize CORS Headers
35
+
|Reduced default CORS headers to minimum required set for improved security, requiring services to explicitly expose additional headers
34
36
|===
35
37
36
38
==== MongoService
@@ -273,6 +275,62 @@ RESTHeart is now officially listed on GraalVM's framework compatibility page as
273
275
- Unified reachability metadata configuration format
274
276
- Explicit initialization of PluginsClassloader for native image execution
275
277
278
+
==== CORS Headers Optimization
279
+
280
+
RESTHeart v9 implements CORS (Cross-Origin Resource Sharing) headers following the principle of least privilege, using minimal defaults that services can extend as needed.
281
+
282
+
**Default CORS Headers:**
283
+
284
+
RESTHeart provides secure, minimal defaults for CORS headers:
// Make Location header accessible to browser clients
323
+
return "Location, ETag";
324
+
}
325
+
}
326
+
----
327
+
328
+
**Key Point:**
329
+
330
+
Response headers like `Location`, `ETag`, or custom headers are not accessible to browser JavaScript unless explicitly exposed via `accessControlExposeHeaders()`. Services that set such headers must override this method.
331
+
332
+
See the link:/docs/plugins/cors[CORS Handling documentation] for complete details and examples.
333
+
276
334
==== Improve Aggregation Pipeline Security with Stage and Operator Blacklisting
277
335
278
336
RESTHeart v9 addresses a security gap where dangerous MongoDB operators could bypass protections when used in aggregation pipelines.
@@ -695,6 +753,12 @@ permissions:
695
753
- Action: Update client applications to use `/token` or `/token/cookie` endpoints
696
754
- Action: Remove `?set-auth-cookie` and similar query parameters from API calls
697
755
756
+
6. **CORS Headers Optimization**
757
+
- **Exposed Headers Changed**: Default `Access-Control-Expose-Headers` is now empty (previously included `Location`, `ETag`, `Auth-Token`, etc.)
758
+
- Action: Services that set response headers like `Location`, `ETag`, or custom headers must implement the `accessControlExposeHeaders()` method to explicitly expose them
759
+
- Action: Review browser-based applications that rely on reading response headers and ensure services expose the necessary headers
760
+
- Note: This is a critical change for services that return `Location` headers (e.g., POST operations that create resources)
0 commit comments