WEB / WEB-11.02
CORS, preflight ve credentials
Atlas browser’ı Catalog API’den readonly liste ister. OPTIONS ön kontrolünü, actual GET’i ve final response exposure kararını sırayla ayır.
1. Core · Mekanizma
Hareket olmadan bütün senaryoları oku
CORS açık
- GET + header seçili
Normal readonly GET, X-Atlas-View header ve include mode seçilidir; cache miss ön kontrol gerektirir.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- Public catalog ready; no receipt
- OPTIONS geldi
Credentials taşımayan preflight API’ye ulaştı; asıl GET ve script exposure henüz gerçekleşmedi.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- OPTIONS received; no Cookie; policy pending
- Sharing policy
API selected origin/credentials/header policy’sine göre ön kontrol response’u hazırladı; bu user authorization değildir.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- 204 response ready; header allowed
- Ön kontrol receipt
Preflight response browser’a ulaştı; receipt ile local permission validation ayrı tutulur.
- Atlas · browser
- Preflight response received; gate pending
- Catalog API
- 204 response ready; header allowed
- Browser ön gate
Browser, original request’in include mode’unu ve unsafe header iznini denetledi; asıl GET’in gönderilmesine izin var.
- Atlas · browser
- Preflight passed; GET ready
- Catalog API
- 204 response ready; header allowed
- Actual GET geldi
Normal readonly GET API’ye ulaştı; selected public catalog response hazırdır ve final browser gate henüz yoktur.
- Atlas · browser
- Preflight passed; GET ready
- Catalog API
- GET received; readonly response ready
- Final response geldi
Actual GET response’u browser’a ulaştı; exact origin + true ACAC seçilidir, script exposure henüz pending.
- Atlas · browser
- Final response received; CORS pending
- Catalog API
- GET received; readonly response ready
- Final CORS gate
Browser final CORS check sonucunu allow verdi; server’a ulaşmış readonly GET geri alınmaz ve body parse çizilmez.
- Atlas · browser
- Script exposure ready; body unread
- Catalog API
- GET received; readonly response ready
Ön kontrol deny
- GET + header seçili
Normal readonly GET, X-Atlas-View header ve include mode seçilidir; cache miss ön kontrol gerektirir.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- Public catalog ready; no receipt
- OPTIONS geldi
Credentials taşımayan preflight API’ye ulaştı; asıl GET ve script exposure henüz gerçekleşmedi.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- OPTIONS received; no Cookie; policy pending
- Sharing policy
API selected origin/credentials/header policy’sine göre ön kontrol response’u hazırladı; bu user authorization değildir.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- 204 response ready; header not allowed
- Ön kontrol receipt
Preflight response browser’a ulaştı; receipt ile local permission validation ayrı tutulur.
- Atlas · browser
- Preflight response received; gate pending
- Catalog API
- 204 response ready; header not allowed
- Browser ön gate
Browser, original request’in include mode’unu ve unsafe header iznini denetledi; asıl GET gönderilmez.
- Atlas · browser
- Preflight denied; no GET; no exposure
- Catalog API
- 204 response ready; header not allowed
Final deny
- GET + header seçili
Normal readonly GET, X-Atlas-View header ve include mode seçilidir; cache miss ön kontrol gerektirir.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- Public catalog ready; no receipt
- OPTIONS geldi
Credentials taşımayan preflight API’ye ulaştı; asıl GET ve script exposure henüz gerçekleşmedi.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- OPTIONS received; no Cookie; policy pending
- Sharing policy
API selected origin/credentials/header policy’sine göre ön kontrol response’u hazırladı; bu user authorization değildir.
- Atlas · browser
- GET/header/include; preflight needed
- Catalog API
- 204 response ready; header allowed
- Ön kontrol receipt
Preflight response browser’a ulaştı; receipt ile local permission validation ayrı tutulur.
- Atlas · browser
- Preflight response received; gate pending
- Catalog API
- 204 response ready; header allowed
- Browser ön gate
Browser, original request’in include mode’unu ve unsafe header iznini denetledi; asıl GET’in gönderilmesine izin var.
- Atlas · browser
- Preflight passed; GET ready
- Catalog API
- 204 response ready; header allowed
- Actual GET geldi
Normal readonly GET API’ye ulaştı; selected public catalog response hazırdır ve final browser gate henüz yoktur.
- Atlas · browser
- Preflight passed; GET ready
- Catalog API
- GET received; readonly response ready
- Final response geldi
Actual GET response’u browser’a ulaştı; wildcard ACAO + include mode seçilidir, script exposure henüz pending.
- Atlas · browser
- Final response received; CORS pending
- Catalog API
- GET received; readonly response ready
- Final CORS gate
GET Catalog API’ye ulaştı ve final response browser’a geldi. Fakat credentials mode include iken ACAO * olduğu için script exposure reddedilir; ACAC true bu uyuşmazlığı düzeltmez. Bu ret GET’i geri almaz, body okunmuş veya DOM güncellenmiş değildir.
- Atlas · browser
- Script exposure denied; GET was sent
- Catalog API
- GET received; readonly response ready
Yalın GET
- Safelisted GET
Seçili readonly GET author header taşımaz ve omit mode’dadır; diğer preflight flag’leri de yoktur.
- Atlas · browser
- GET/omit; no author header
- Catalog API
- Public catalog ready; no receipt
- GET receipt
Ön kontrol gerekmeyen normal GET API’ye ulaştı; selected public-read response hazırlandı.
- Atlas · browser
- GET/omit; no author header
- Catalog API
- GET received; wildcard response ready
- Response receipt
Wildcard ACAO içeren response browser’a ulaştı; omit mode’daki final CORS check hâlâ ayrı adımdır.
- Atlas · browser
- Response received; CORS pending
- Catalog API
- GET received; wildcard response ready
- Exposure ready
Omit profilinde wildcard final check’i geçti; bu yalnız script exposure’dır, DOM render veya server action izni değildir.
- Atlas · browser
- Script exposure ready; body unread
- Catalog API
- GET received; wildcard response ready
ROLLER · STATE · VERİ AKIŞI
Server response’u hangi script’e açar?
CORS, server’ın HTTP response üzerinden browser’a belirli origin’deki script için sharing izni bildirdiği mekanizmadır. API’de hangi kullanıcının hangi işlemi yapabildiğini belirleyen authorization sistemi değildir. Atlas https://atlas.example.org origin’inden https://catalog.example.org/list için normal fetch ister. Browser cors mode’da response’u script’e açmadan CORS check uygular. Access-Control-Allow-Origin tek serialized origin veya uygun credentials mode’da wildcard olabilir; comma-separated origin listesi birden fazla origin’i böyle yetkilendirmez. CORS check geçse de body okuma ve JSON parse ayrı aşamalardır.
Sahnede Atlas browser ile Catalog API vardır. GET’e X-Atlas-View: compact presentation header’ı eklendiği için preflight gerekir; bu isim standard header değildir. API, public read policy’siyle readonly catalog sunar. OPTIONS bu business policy’nin veya kullanıcının yetkisinin kanıtı değildir. Final response alındıktan sonra browser-local CORS kontrolü ayrıca yapılır. Script exposure ready olması, body’nin okunup DOM’a render edildiğini göstermez.
Preflight sadece method’a bakmaz
CORS-safelisted methods GET, HEAD ve POST’tur; fakat GET kullanmak tek başına preflight’i kaldırmaz. Author-controlled request header adları ve değerleri de safelist koşullarını sağlamalıdır. X-Atlas-View adı safelisted değildir. Content-Type’ın MIME essence’i yalnız application/x-www-form-urlencoded, multipart/form-data veya text/plain olduğunda ve value koşulları sağlandığında safelisted olabilir; JSON buna girmez. Accept için unsafe-byte ve 128-byte sınırı, dil header’ları için karakter koşulları ve Range için single-byte-range sınırı vardır. Streaming upload veya explicit preflight flag gibi ek koşullar da profile’e göre önemlidir.
Browser cross-origin ön kontrolde OPTIONS gönderir; Access-Control-Request-Method gelecekteki GET’i, Access-Control-Request-Headers ise unsafe header adlarını bildirir. Fetch standardında preflight’in credentials mode’u same-origin olduğundan cross-origin credentials taşımaz; buna karşın original request include ise preflight response bu kullanımın iznini de sağlamalıdır. Selected cache miss branch’inde ok-status response, origin/credentials ve gereken header izinleri geçmeden actual GET gönderilmez. Preflight cache hit yeni OPTIONS gerektirmeyebilir; cache HTTP response cache’iyle aynı mekanizma değildir. MDN, bazı enterprise TLS client-certificate kullanımlarında implementation’ın standardın bu kuralından ayrılabildiğini kaydeder; fixture normatif profili seçer, bütün browser’larda gerçek wire sonucunu vaat etmez.
include bir Cookie gönderme emri değildir
Fetch credentials default’u same-origin’dir; cross-origin’de include uygun credentials kullanımına izin veren mode’dur. Cookie’nin varlığı, Domain/Path/Secure, SameSite ve browser privacy policy ayrıca gönderimi etkiler. include seçmek olmayan veya policy’nin engellediği cookie’yi yaratmaz. Final CORS check include mode’a göre exact ACAO ve case-sensitive true ACAC ister; network’te gerçekten Cookie bulunmamış olsa da wildcard ACAO bu mode’da kabul edilmez. omit ile wildcard seçili public response için geçebilir.
ACAM, ACAH ve expose-header wildcard’ları include bağlamında geniş izin anlamına gelmez. Authorization header’ı da non-wildcard request-header adıdır; genel wildcard ile onun izni varsayılmaz. Response header exposure ayrı allowlist’tir; Set-Cookie script’e açılacak normal header değildir. Vary: Origin, response policy’si request origin’e göre değişip cache edilebiliyorsa cache variation’ı belirtir; her fixed/wildcard response için evrensel zorunluluk diye sunulmaz. Vary private response’u public cache için güvenli hale getirmez.
2. Red · Güven ve etki
Hareket olmadan bütün senaryoları oku
Preflight deny
- Method ile author header birlikte seçildi
Readonly GET, X-Atlas-View compact header’ıyla cors/include profile’dadır. Seçilmiş preflight cache miss’tir. GET label’ı tek başına no-preflight sonucu vermez; header name/value de gereksinime katılır.
- Catalog request facts
- GET + X-Atlas-View / preflight needed
- Preflight/final policy
- Sharing gate bekliyor
- Send/exposure boundary
- Exposure verdict yok
- OPTIONS credentials ile actual request ayrıldı
Preflight credentialsMode same-origin ve crossOriginCredentialsSent false’tur. OPTIONS original request’in GET/header iznini sorar. Include usage’ı response policy’de ayrıca izin ister; OPTIONS credential bytes taşımıyor diye final include şartı kaldırılmaz.
- Catalog request facts
- GET + X-Atlas-View / preflight needed
- Preflight/final policy
- Preflight OPTIONS / cross-origin credentials not sent
- Send/exposure boundary
- Exposure verdict yok
- Missing header izni actual GET’i durdurdu
preflightHeaderAllowed false, preflightAccepted false ve actualGetSent false olur. finalACAO not received’dır. Bu branch için server’ın asıl GET’in alındığı’i uydurulmaz; OPTIONS observation başka exchange’dir.
- Catalog request facts
- GET + X-Atlas-View / preflight needed
- Preflight/final policy
- Preflight OPTIONS / cross-origin credentials not sent
- Send/exposure boundary
- Preflight denied / actual GET not sent
- Plain GET normal negative comparison oldu
plain-get safelisted input’la preflightNeeded false ve credentials omit seçer. ACAO wildcard ile scriptExposed true olur. Aynı GET method iki farklı header/credentials context’inde farklı gates izleyebilir.
- Catalog request facts
- Plain omit GET / no preflight / exposed
- Preflight/final policy
- Preflight OPTIONS / cross-origin credentials not sent
- Send/exposure boundary
- Preflight denied / actual GET not sent
- Safelist requirement narrow fixture’da kaldı
Artifact normal Accept value lengths 128 ve 129 byte örneklerini ayırır. Method, name ve value birlikte gerekir. Bu bounded ASCII matrix full Fetch safelist/MIME parser değildir; arbitrary headers için genel sonucuna dönüşmez.
- Catalog request facts
- Plain omit GET / no preflight / exposed
- Preflight/final policy
- Method/name/value scope retained
- Send/exposure boundary
- Preflight denied / actual GET not sent
- Send gate server authorization sayılmadı
Preflight başarısı veya yokluğu user/object grant’i sağlamaz. ServerActionPolicy seçilen public-read işlemi için bağımsızdır; mutation yapılmaz. CORS failure da CSRF protection veya server’in bütün requests’i reddettiği kanıtı değildir.
- Catalog request facts
- Plain omit GET / no preflight / exposed
- Preflight/final policy
- Method/name/value scope retained
- Send/exposure boundary
- Send policy scoped / server authz independent
Final exposure
- Preflight accepted final gate’ten ayrıldı
final-blocked preflightHeaderAllowed ve preflightAccepted true verir; actualGetSent true’dur. Bu branch GET’in server’a ulaştığı normal readonly flow’u temsil eder. Final response gate henüz başka koşulu değerlendirecektir.
- Catalog request facts
- Preflight accepted / GET sent
- Preflight/final policy
- Sharing gate bekliyor
- Send/exposure boundary
- Exposure verdict yok
- Include mode wildcard ile açılmadı
Final ACAO *, ACAC true ve credentialsMode include’dur. Bu combination scriptExposed false verir. Cookie gerçekten gönderilmemiş olsa da include mode wildcard prohibition’ı devam eder; mode ile cookie bytes ayrı conditions’dır.
- Catalog request facts
- Preflight accepted / GET sent
- Preflight/final policy
- Include + ACAO* → exposure false
- Send/exposure boundary
- Exposure verdict yok
- Exposure deny server receipt’i geri almadı
actualGetSent true kalır; script body’ye erişemez. Final CORS error, server request’i hiç görmedi demek değildir. Mutating action’larda server-side policy gerekir; bu fixture yalnız public readonly GET’tir.
- Catalog request facts
- Preflight accepted / GET sent
- Preflight/final policy
- Include + ACAO* → exposure false
- Send/exposure boundary
- GET sent / script withheld / server policy separate
- Exact-origin positive control farklı result verdi
Normal finalACAO https://atlas.example.org ve finalACAC true verir; include mode’da scriptExposed true olur. Origin serialized text’in sonuna slash eklemek aynı value değildir. ACAC True case’i de lowercase true ile eşit kabul edilmez.
- Catalog request facts
- Exact origin + ACAC true → exposure true
- Preflight/final policy
- Include + ACAO* → exposure false
- Send/exposure boundary
- GET sent / script withheld / server policy separate
- Sharing policy private data’yı public yapmadı
Dynamic Origin response için Vary Origin variation’ı belirtir; privateDataMadePublicByVary false’tur. CORS sharing, response classification veya object permission’ın yerine geçmez. Preflight cache ile HTTP response cache ayrı scopes’tur.
- Catalog request facts
- Exact origin + ACAC true → exposure true
- Preflight/final policy
- Sharing/Vary scope / private policy separate
- Send/exposure boundary
- GET sent / script withheld / server policy separate
- Control final response contract’ında kaldı
Approved serialized origin ve exact lowercase true açık config’den seçilir. Model gerçek browser, network veya cookie storage çalıştırmaz. Doğru exposure sonucu current session/resource authority’yi bağımsız doğrulamayı gereksiz yapmaz.
- Catalog request facts
- Exact origin + ACAC true → exposure true
- Preflight/final policy
- Sharing/Vary scope / private policy separate
- Send/exposure boundary
- Final sharing checked / current authority separate
VARSAYIM · SINIR · KONTROL
Hangi deny request’i durdurur?
Preflight-denied branch’inde normal OPTIONS server’a ulaşır; X-Atlas-View izni eksik olduğundan browser actual GET’i göndermez. Final-blocked branch’inde ön kontrol geçer ve readonly GET server’a ulaşır; final response yanlış wildcard ile include mode’a sunulduğundan script exposure deny olur. İki deny aynı ağ sonucu değildir. Son CORS hatası server’ın GET receipt’ini geri almaz; bu örnekte mutation yoktur fakat server-side işlem izinlerinin CORS dışında korunması gerektiğini gösterir.
Method’a bakıp “GET preflight istemez” diyen diagnostic, header name/value koşulunu kaybeder. Artifact 128-byte ve 129-byte normal Accept değerlerini aynı method ile karşılaştırır; value sınırı sonucu değiştirir. Çok sayıda safelisted value’nun toplam boyutu için Fetch’in ek sınırı da vardır; local checker yalnız açıkça listelenmiş dar value setini kontrol eder. Method, header ve body API’nin legal request formatını anlatır; CORS permission veya user authorization bunlarla otomatik oluşmaz.
Sharing genişlerse etki nedir?
Origin allowlist’in gevşemesi script-readable veri sınırını genişletebilir; bu etki, response’un hassasiyeti ve credential bağlamıyla değerlendirilir. CORS success session sahibinin her object’i okuyabildiğini kanıtlamaz; CORS failure da CSRF protection kanıtı değildir. Credential gönderimi ve script exposure’ı aynı boolean’da birleştirmek özellikle misleading olur. Bu ders yalnız owned synthetic endpoint’lerin normal readonly fixtures’ını kullanır; header manipulation, üçüncü hedef veya bypass akışı göstermez.
3. Blue · Güvenli geliştirme ve savunma
Hareket olmadan bütün senaryoları oku
Matrix review
- Dört outcome send ve expose fields’iyle okundu
Sahnedeki Catalog API preflight/final response koşullarını, Atlas browser ise bu yanıtın alınması sonrası exposure kararını sahiplenir. cases/headerCases/exposureCases authored policy kayıtlarıdır; gerçek access log’u değildir. preflight-denied yalnız OPTIONS’a ulaşır, final-blocked GET’e de ulaşır. omitted body/JSON/DOM aşamaları script exposure’dan türetilemez. Normal sent/exposed true, preflight deny false/false, final blocked true/false ve plain omit GET true/true’dur. Tek CORS success boolean bu farklı network ve script sonuçlarını gizler.
- CORS observations
- Allow T/T / preflight F/F / final T/F / plain T/T
- Eligibility/exposure review
- Sharing gate bekliyor
- Evidence verdict
- Exposure verdict yok
- Cookie eligibility mode’dan bağımsız koşullar istedi
Include mode cookie’yi otomatik göndermez; exists, scopeAndSecure ve sameSiteAndPrivacy gerekir. Cross-origin same-origin veya omit rows expectedSent false’tur. Bu declared predicates gerçek cookie byte’ları içermeden karşılaştırılır.
- CORS observations
- Allow T/T / preflight F/F / final T/F / plain T/T
- Eligibility/exposure review
- Include + existence/scope/privacy required
- Evidence verdict
- Exposure verdict yok
- No-cookie row final include rule’ını korudu
Exposure matrix include/ACAO*/ACAC true/cookieSent false için expected false verir. Gönderilen credential’ın bulunmaması ile request credentialsMode aynı fact değildir. Cookie gate sonucunu final sharing gate’in yerine geçirmek yanlış inference’dır.
- CORS observations
- No cookie does not relax include wildcard rule
- Eligibility/exposure review
- Include + existence/scope/privacy required
- Evidence verdict
- Exposure verdict yok
- Origin ve ACAC exact values ile sınandı
Omit mode wildcard allow olabilir; include exact-origin/lowercase true ister. ACAC True false, ACAO origin-with-slash false controls’üdür. Normal field syntax, sharing outcome’un doğru scope’ta açıklanmasını sağlar.
- CORS observations
- No cookie does not relax include wildcard rule
- Eligibility/exposure review
- Exact origin and lowercase true checked
- Evidence verdict
- Exposure verdict yok
- Cache inventories farklı contracts olarak tutuldu
HTTP response Vary Origin ile partitioned preflight cache aynı store değildir. CacheProfile timers false ve preflightCacheDistinct true’dur. Expiration veya gerçek cache hit ölçülmeden maximum-age timing claim’i eklenmez.
- CORS observations
- No cookie does not relax include wildcard rule
- Eligibility/exposure review
- Exact origin and lowercase true checked
- Evidence verdict
- HTTP variation ≠ preflight cache / timers unmeasured
- Matrix sonucu native Fetch proof olmadı
Bu dar ASCII/policy fixture normal salt okunur girdiler kullanır. Redirects, browser-specific differences, cookie storage ve response-body DOM behavior kapsam dışındadır. Native typed predicates doğru olsa da browser’ın gerçekten uyguladığı kurallar ayrıca ölçülmelidir.
- CORS observations
- No cookie does not relax include wildcard rule
- Eligibility/exposure review
- Exact origin and lowercase true checked
- Evidence verdict
- Finite policy known / Fetch-browser runtime unmeasured
Phase gap
- Final error label hangi phase’de oluştu diye soruldu
Sahnedeki Catalog API preflight/final response koşullarını, Atlas browser ise bu yanıtın alınması sonrası exposure kararını sahiplenir. cases/headerCases/exposureCases authored policy kayıtlarıdır; gerçek access log’u değildir. preflight-denied yalnız OPTIONS’a ulaşır, final-blocked GET’e de ulaşır. omitted body/JSON/DOM aşamaları script exposure’dan türetilemez. Alternatif review yalnız CORS error label’ı görür; preflight ve asıl GET observation’ları yoktur. Bu label preflight deny veya final exposure deny olabilir. Normal matrix’teki iki farklı send sonucu bu belirsizliği açıklar.
- CORS observations
- Error label only / phase unobserved
- Eligibility/exposure review
- Sharing gate bekliyor
- Evidence verdict
- Exposure verdict yok
- Final error actual request receipt’ine karar vermedi
Preflight-denied actualGetSent false, final-blocked true’dur. Missing phase records varken ikisinden biri tahmin edilmez. Client-readable exposure ile server receipt farklı observers’ın evidence’ıdır.
- CORS observations
- Error label only / phase unobserved
- Eligibility/exposure review
- Error alone cannot determine GET sent
- Evidence verdict
- Exposure verdict yok
- Normal row missing observation yerine taşınmadı
Normal preflight 204 ve exact-origin final response expected flow’dur. Bu values incomplete trace’in response fields’i gibi kopyalanmaz. Cache hit possibility de seçilen cache-miss fixture’dan genellenmez.
- CORS observations
- Expected normal flow is not missing-phase evidence
- Eligibility/exposure review
- Error alone cannot determine GET sent
- Evidence verdict
- Exposure verdict yok
- Required evidence send ve exposure’a ayrıldı
Preflight result ve asıl request’in alındığına dair kayıt send sorusunu, final ACAO/ACAC/mode ile browser exposure outcome read sorusunu yanıtlar. Network panel’de header görünmesi script API’de header okunabilirliğini ayrıca kanıtlamaz.
- CORS observations
- Expected normal flow is not missing-phase evidence
- Eligibility/exposure review
- Need phase/result/receipt plus final exposure fields
- Evidence verdict
- Exposure verdict yok
- Send verdict ve server action unknown kaldı
Bu review için asıl GET’in gönderilip gönderilmediği UNKNOWN’dur. User/action authorization veya mutation hakkında evidence yoktur. CORS error’ı CSRF control başarısı veya server no-op kanıtı diye yazmak scope’u aşar.
- CORS observations
- Expected normal flow is not missing-phase evidence
- Eligibility/exposure review
- Need phase/result/receipt plus final exposure fields
- Evidence verdict
- UNKNOWN: actual GET sending / server action
- Yeni evidence minimum phase correlation’a sınırlandı
İlerlemek için scoped request origin, method/header names, preflight outcome ve final exposure record gerekir. Cookie/token bytes veya full private body toplamak şart değildir. Server policy sorusu bağımsız evidence ister.
- CORS observations
- Expected normal flow is not missing-phase evidence
- Eligibility/exposure review
- Need phase/result/receipt plus final exposure fields
- Evidence verdict
- Collect scoped phase evidence; server policy separately
UYGULAMA · GÜVENLİK KONTROLÜ · DOĞRULAMA
Sharing policy ile API policy’yi ayrı işlet
Sahnedeki Catalog API preflight/final response koşullarını, Atlas browser ise bu yanıtın alınması sonrası exposure kararını sahiplenir. cases/headerCases/exposureCases authored policy kayıtlarıdır; gerçek access log’u değildir. preflight-denied yalnız OPTIONS’a ulaşır, final-blocked GET’e de ulaşır. omitted body/JSON/DOM aşamaları script exposure’dan türetilemez. Atlas entegrasyonu permitted serialized origin’i configuration’dan seçer; include profilinde ACAO exact ve ACAC true olur. OPTIONS route’u browser’ın credential taşımayan ön kontrolünü karşılar; actual resource route kullanıcı/session ve object kurallarını bağımsız uygular. Public catalog örneğinde seçili policy public-read’dir ve state-changing action yoktur. Bir error response da uygun CORS header’larıyla script’e açılabilir; HTTP status başarılı business sonucu ile aynı değildir. Preflight ise ok-status ister.
Regression normal allow, missing-header preflight deny, final wildcard/include deny ve no-preflight omit GET’i ayrı izler. Header/value matrix ön kontrol gereksinimini açıklarken cookieEligibility matrix gönderim koşullarını gösterir; include-with-no-cookie satırı final CORS wildcard yasağını yine korur. Final gate’de response received ile response exposed farklı state’tir. Yerel step sırası, verilen policy kararının ne zaman oluştuğunu gösterir; browser’ın gerçek Fetch algoritması veya Cookie gönderimi için ayrı gözlem gerekir.
İki farklı cache policy
Cache incelemesinde iki policy’yi kaydet: HTTP response’ın Origin’e göre variation’ı ve browser preflight cache’inin origin/URL/credentials/method/header scope’u. Max-Age browser limitleriyle kısıtlanabilir; bu fixture gerçek cache timer çalıştırmaz. Response header’larını script’te görmek için expose policy gerekir; browser devtools’ta görünmeleri script API’de erişilebilir olduklarını ispatlamaz. Actual network, browser privacy setting, streaming upload ve endpoint authorization için ayrı izole integration evidence tutulmalıdır.
ŞİMDİ VAKAYA UYGULA
Preflight, final exposure ve credential eligibility neden ayrı gates’tir?
Atlas, public katalog için X-Atlas-View header’ı içeren bir GET hazırlıyor. Header’a izin verilmezse preflight, asıl GET gönderilmeden akışı durduruyor. Ön kontrol geçse bile include mode ile dönen wildcard response script’e açılamıyor. İsteğin gönderilmesiyle response’un okunabilmesini iki ayrı karar olarak izleyeceğiz.
Vakadaki browser policy hangi ilişkiyi kontrol ediyor? Response exposure, destination veya framing kararını server’ın object permission kararıyla karıştırmadan açıkla.
Bağlı vaka dosyasını aç ↗ÖRNEĞİ BİRLİKTE OKUYALIM
Catalog sharing ve send gate tablosu
Bir alan seç; hangi sonucu desteklediğini ve nerede yetersiz kaldığını incele.
Ham kaydı ve alan açıklamalarını oku
{
"profile": {
"requestOrigin": "https://atlas.example.org",
"url": "https://catalog.example.org/list",
"mode": "cors",
"method": "GET",
"authorHeader": {
"name": "X-Atlas-View",
"value": "compact"
},
"preflightCache": "selected miss",
"credentials": "include",
"readOnly": true,
"serverActionPolicy": "selected public-read, independent of CORS",
"actualBrowser": false,
"actualNetwork": false,
"actualCookieBytes": false
},
"headerCases": [
{
"method": "GET",
"headers": [],
"expectedPreflight": false
},
{
"method": "GET",
"headers": [
{
"name": "X-Atlas-View",
"value": "compact"
}
],
"expectedPreflight": true
},
{
"method": "POST",
"headers": [
{
"name": "Content-Type",
"value": "text/plain;charset=UTF-8"
}
],
"expectedPreflight": false
},
{
"method": "POST",
"headers": [
{
"name": "Content-Type",
"value": "application/json"
}
],
"expectedPreflight": true
},
{
"method": "GET",
"headers": [
{
"name": "Accept",
"value": "text/plain;atlas=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
],
"expectedPreflight": false
},
{
"method": "GET",
"headers": [
{
"name": "Accept",
"value": "text/plain;atlas=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
],
"expectedPreflight": true
}
],
"preflight": {
"method": "OPTIONS",
"credentialsMode": "same-origin",
"crossOriginCredentialsSent": false,
"requestMethod": "GET",
"requestHeaderNames": [
"x-atlas-view"
],
"responseStatus": 204,
"ACAO": "https://atlas.example.org",
"ACAC": "true",
"ACAM": [
"GET"
],
"ACAH": [
"X-Atlas-View"
],
"normativeFetchProfile": true
},
"cases": [
{
"case": "normal",
"preflightNeeded": true,
"preflightHeaderAllowed": true,
"preflightAccepted": true,
"credentialsMode": "include",
"finalACAO": "https://atlas.example.org",
"finalACAC": "true",
"actualGetSent": true,
"scriptExposed": true
},
{
"case": "preflight-denied",
"preflightNeeded": true,
"preflightHeaderAllowed": false,
"preflightAccepted": false,
"credentialsMode": "include",
"finalACAO": "not received",
"finalACAC": "not received",
"actualGetSent": false,
"scriptExposed": false
},
{
"case": "final-blocked",
"preflightNeeded": true,
"preflightHeaderAllowed": true,
"preflightAccepted": true,
"credentialsMode": "include",
"finalACAO": "*",
"finalACAC": "true",
"actualGetSent": true,
"scriptExposed": false
},
{
"case": "plain-get",
"preflightNeeded": false,
"preflightHeaderAllowed": "not needed",
"preflightAccepted": "not needed",
"credentialsMode": "omit",
"finalACAO": "*",
"finalACAC": null,
"actualGetSent": true,
"scriptExposed": true
}
],
"exposureCases": [
{
"mode": "omit",
"ACAO": "*",
"ACAC": null,
"expected": true
},
{
"mode": "include",
"ACAO": "*",
"ACAC": "true",
"cookieSent": false,
"expected": false
},
{
"mode": "include",
"ACAO": "https://atlas.example.org",
"ACAC": "true",
"expected": true
},
{
"mode": "include",
"ACAO": "https://atlas.example.org",
"ACAC": "True",
"expected": false
},
{
"mode": "omit",
"ACAO": "https://atlas.example.org/",
"ACAC": null,
"expected": false
}
],
"cookieEligibility": [
{
"mode": "include",
"exists": true,
"scopeAndSecure": true,
"sameSiteAndPrivacy": true,
"expectedSent": true
},
{
"mode": "include",
"exists": true,
"scopeAndSecure": true,
"sameSiteAndPrivacy": false,
"expectedSent": false
},
{
"mode": "include",
"exists": false,
"scopeAndSecure": true,
"sameSiteAndPrivacy": true,
"expectedSent": false
},
{
"mode": "same-origin",
"exists": true,
"scopeAndSecure": true,
"sameSiteAndPrivacy": true,
"expectedSent": false
},
{
"mode": "omit",
"exists": true,
"scopeAndSecure": true,
"sameSiteAndPrivacy": true,
"expectedSent": false
}
],
"cacheProfile": {
"dynamicOriginResponse": true,
"Vary": [
"Origin"
],
"privateDataMadePublicByVary": false,
"preflightCacheDistinct": true,
"actualTimers": false,
"partitionKeyScope": "network partition key plus request origin/URL/credentials/method/header"
},
"omitted": [
"redirects",
"browser-specific preflight/credential differences",
"streaming uploads and explicit preflight flag",
"full MIME/range/header safelist parser",
"HTTP and preflight cache execution",
"cookie storage/Set-Cookie",
"response body/JSON/DOM"
]
}- headerCases
- Method ile header name/value birlikte; dar ASCII örnekleri.
- preflight
- Credential-free OPTIONS; original include izni response’da ayrıca gerekir.
- cases
- Actual GET send ve final script exposure ayrı sonuçlardır.
- exposureCases
- Exact origin ve byte-case-sensitive true kontrolü.
- cookieEligibility
- Mode ile cookie policy farklıdır; gerçek cookie gönderilmez.
- cacheProfile
- Selected dynamic HTTP variation, separate preflight cache.
Dar normal readonly CORS policy fixture’ı; generic Fetch, MIME/header parser veya browser emulator değildir. Credentials koşulları deklaratiftir; token/cookie bytes ve network yoktur.
İki yanlış kanı
GET kullanan her fetch preflight’sizdir.
Author header name/value ve diğer Fetch koşulları da gerekir; custom presentation header GET için ön kontrol isteyebilir.
CORS deny server’ın request’i hiç işlemediğini kanıtlar.
Preflight deny actual request’i durdurabilir; final exposure deny daha önce ulaşmış request’i geri almaz.
SIRA SENDE
Bu hikâyeyi sen çöz.
Sonucu tahmin et, kanıtın sınırını bul ve nedenini kendi cümlenle anlat.
Catalog GET için preflight kabul edildi. Final response ACAO: * ve ACAC: true taşıyor; credentials mode include. Hangi çift sonuç beklenir?
- GET gönderildi; response script’e açılmaz.
- GET gönderilmedi; response hiç oluşmadı.
- ACAC true olduğundan GET response’u script okuyabilir.
Gerekçeli cevabı oku
GET gönderildi; response script’e açılmaz. — Fixture’ın actualGetSent=true ve scriptExposed=false alanları iki ayrı sınırı gösterir. CORS exposure engeli server’daki olası işleme için authorization veya geri alma mekanizması değildir.
Bu iki Content-Type kaydında aynı POST method’u var. Neden preflight beklentileri farklıdır?
Seçilen dar header fixture’ı; browser capture değildir
- POST / Content-Type #1
- text/plain;charset=UTF-8 → expectedPreflight=false
- POST / Content-Type #2
- application/json → expectedPreflight=true
- profile
- selected ASCII values; other safelist conditions satisfied
- Value farkı safelist değerlendirmesini değiştirir.
- POST her zaman preflight gerektirir; ilk kayıt yanlıştır.
- İkinci kaydın preflight’ı kullanıcının yetkili olduğunu kanıtlar.
Gerekçeli cevabı oku
Value farkı safelist değerlendirmesini değiştirir. — Bu sonlu örnek yalnız iki value’nun belirtilen koşullardaki ayrımını öğretir. Generic MIME/header parser veya gerçek browser yürütümü iddiası oluşturmaz.
include mode seçilmiş fakat uygun Cookie yok. Bu, wildcard ACAO’nun include-mode response için geçerli hale geldiği anlamına gelir mi? Ayrıca CORS ile application permission’ı ayır.
Gerekçeli cevabı oku
Hayır. Seçilen CORS check credentials mode’a bakar; bu request’te Cookie gönderilmemesi include mode’u omit’e dönüştürmez. Cookie gönderimi varlık, scope/Secure, SameSite/privacy gibi koşullara bağlıdır. CORS response’u hangi script’in okuyabileceğini sınırlar; server’ın resource/action permission kararı ayrıca uygulanmalıdır.
□ include mode ile Cookie bytes gönderilmesini eşitlemedim.
□ Wildcard sınırını mode üzerinden açıkladım.
□ Script exposure ile server authorization’ı ayırdım.
Uygulama konsolunu aç · request / response / browser
Request, URL, cookie ve DOM örneklerini ayrıca aç
Kaynaklar ve kapsam
- WHATWG Fetch — CORS protocol and algorithms§2.2.1 CORS-safelisted method; §2.2.2 CORS-safelisted request-header · §3.3.2 HTTP requests; §3.3.3 HTTP responses · §3.3.5 CORS protocol and credentials · §4.8 CORS-preflight fetch; §4.9 CORS-preflight cache; §4.10 CORS check · §2.2.2 forbidden response-header; §3.1 Cookie infrastructure
- MDN — Cross-Origin Resource Sharing (CORS)Simple requests; Preflighted requests · Requests with credentials; Preflight requests and credentials · Access-Control-Allow-Origin and Vary: Origin · Access-Control-Expose-Headers
- MDN — Same-origin policyDefinition of an origin; Inherited origins; File origins · Cross-origin network access: writes, embeds, reads · Cross-origin script API access: Window and Location · Cross-origin data storage access