fix(server): refuse cross-site requests on the terrain-heights route

Follow-up to #686 requested on #923. The route's per-client limiter keys on the socket address, which for a cross-site <img> is the visitor's own browser, so any web page could fill the bounded cache with junk keys and spend the visitor's 90/min quota, leaving the app's own terrain lookups on 429. Gate the route with admitSameSite before the limiter, like the Places routes.

Co-authored-by: daikaginza <[email protected]>
This commit is contained in:
Sunilanddaikaginza committed 2026-10-08 21:13:16 +05:30
1 parent bea76df454
commit ff799d1520
4 files changed
+58 -4

No files matched your search

+3 -1
View File
@@ -113,7 +113,9 @@
"server/providers/terrain.js",
"src/data/terrainHeightsProxy.js",
"server/providers/common/rate-limit.js",
"src/sources/rateLimit.js"
"src/sources/rateLimit.js",
"server/providers/common/same-site.js",
"src/localRequestGate.mjs"
],
"external": []
},