Skip to content
Home · Sonraki hedefe 100 XP
Son hareketler
Henüz bir öğrenme hareketi yok. İlk derse başlayın.

Web Application Security

CORS: Distinguishing Browser Read Permissions from Authentication

CORS determines whether the browser will open a response from another origin to the script. It is not an authorization system that prevents requests from being sent to the server or prevents non-browser clients in general.

Bu derste neler var?

SIBERSALDIRI.COM · FOCUSED LESSON

What you will learn

  • Explain the relationship between Origin and Sharing policy.
  • “Does CORS stop all requests?” To give a reasoned answer to the question.
  • Changing the example and comparing expected and observed behavior.

How it works and where the trust boundary lies

Origin is a combination of schema, host and port. The origin that is allowed for use with credentials must be selected in a clear and reliable manner. Do not reflect incoming Origin uncontrolled; Map the frontend need to the exact list. Even if CORS is fixed, CSRF and object authorization remain separate. Also consider the varying responses in cache behavior by origin.

CORS: Flow for separating identity with browser read permission: Origin → Sharing policy → Browser access
Origin → Sharing policy → Browser access. The diagram shows the relationship; It does not replace the entire application.

Worked example

The following passage makes the concept visible. Evaluate samples containing commands or code in your own separate testing environment, not in the production system. Architectural diagrams and policy examples are not executable programs.

Politika örneği:
İzinli origin: https://app.example.com
İzinli yöntem: GET
Kaynak yetkisi: sunucuda ayrıca
İzinli olmayan origin: yanıt okumasına izin yok

Expected result and interpretation

Policy limits browser read access; The API does not remove the identity rule.

Compare the scenarios

StatusRecommended approachWhy?
authorized originBrowser sharingAPI authorization also required
Random origin reflectedOpen permission listtrust boundary is uncertain
Curl sends requestUnderstand the expected limitCORS is not a public network barrier

Practice task

Example why different ports of the same URL create different origins.

  1. Write down the expected outcome and acceptance condition before the action.
  2. Change a single variable; Record the observation and the medium you used.
  3. Evaluate the result with the comparison table above. Explain which assumption might be wrong if it does not fit.

Common mistake and how to correct it

Do not use the CORS setting in place of an API key or CSRF check.

Test your understanding

Does CORS stop all requests?

Answer explained: No. Its main role is to regulate response sharing between origins in the browser.

Continue with related lessons

Technical reference

The explanation and examples of this course have been re-prepared for the academy. The link below is a technical reference to verify details of the technology or security approach used.

Bir adım daha ilerlediniz.

Dersi bitirdiyseniz tamamlandı olarak işaretleyin. İlerlemeniz bu cihazda saklanır.

Academy menu

Akademide ara

En az 2 karakter yazın.