Skip to content

Commit 031091b

Browse files
sametbasbugclaude
andcommitted
Record that CSRF protection on sign-in comes from Astro
Measured against production after the deploy: a POST to /giris/orbit with no Origin, or a foreign one, is refused with 403 before reaching the route, while a same-origin POST gets the 503 the handler returns while Orbit is unconfigured. That 403 is Astro's security.checkOrigin default, not anything in this file -- so the route has no CSRF check of its own and would quietly lose one if that default were ever turned off. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent cef6b8e commit 031091b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/server/routes/giris.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
* kullanıcıyı başka siteye gönderiyor). GET olsaydı bir görsel etiketi ya da
55
* bir önyükleyici bu akışı kullanıcının haberi olmadan tetikleyebilirdi.
66
* Ayrıca kenar önbelleği yalnız GET'i tutuyor; POST hiç uğramıyor.
7+
*
8+
* POST seçmenin ikinci ve TAŞIYICI sonucu: Astro'nun `security.checkOrigin`
9+
* varsayılanı sunucu modunda yabancı kaynaklı POST'ları 403 ile kesiyor,
10+
* yani CSRF koruması buradan geliyor. Canlıda ölçüldü — Origin'siz veya
11+
* yabancı Origin'li POST 403, aynı kaynaktan gelen 503 (yapılandırılmamış).
12+
* `astro.config.ssr.mjs` içinde `security.checkOrigin` kapatılırsa bu rota
13+
* korumasız kalır; kapatmadan önce buraya kendi kontrolünü ekle.
714
*/
815
import type { APIRoute } from 'astro';
916
import { getWorkerEnv } from '#runtime-env';

0 commit comments

Comments
 (0)