Is CORS request without Origin allowed?

Ivan Fioravanti

Is it correct that a request without "Origin" in header versus a CORS protected resource Access-Control-Allow-Origin set to a specific fqdn receive a correct 200 response?

I was expecting an error like when Origin is set to a different fqdn than the one allowed, while it works perfectly.

DaveMongoose

CORS protection is designed to prevent one website triggering activity on another website using your credentials, e.g. a script on A.com posting data to B.com via an AJAX request.

The Origin header is automatically set by the browser (and cannot be overridden) if a site triggers a request to a different domain*. This is checked against the 'Access-Control-Allow-Origin' header on the second site.

If you are directly accessing B.com in a browser then Origin will be blank because you are on the same site: CORS is not relevant. Manually setting an Origin header will mimic the restriction behaviour but it's not the normal scenario that CORS is designed to protect the user from.

*Certain types of request (such as loading images or scripts) are not blocked by CORS protection

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is CORS request without Origin allowed?

From Dev

CORS Origin Request not allowed

From Dev

Dealing with Origin http://localhost is not allowed by Access-Control-Allow-Origin Without CORS header

From Dev

Dealing with Origin http://localhost is not allowed by Access-Control-Allow-Origin Without CORS header

From Dev

CORS - localhost as allowed origin in production

From Dev

Why Ajax GET request without CORS is blocked, but JSONP is allowed?

From Dev

Cross origin request with CORS filter

From Dev

Safari issue with CORS: Origin is not allowed by Access-Control-Allow-Origin

From Dev

Origin is not allowed by Access-Control-Allow-Origin without solution

From Dev

Request header field Access-Control-Allow-Origin is not allowed

From Dev

Cors request method PUT is not allowed by Access-Control-Allow-Methods

From Dev

header('Access-Control-Allow-Origin: *'); Not allowing CORS request

From Dev

Internet Explorer 11 does not add the Origin header on a CORS request?

From Dev

Internet Explorer 11 does not add the Origin header on a CORS request?

From Java

“Origin null is not allowed by Access-Control-Allow-Origin” error for request made by application running from a file:// URL

From Dev

Cross-Domain Request without CORS or JSONP

From Dev

CORS request not working without chrome plugin

From Dev

CORS allowed-origin restrictions aren’t causing the server to reject requests

From Dev

CORS Security: Set Access-Control-Allow-Origin to Origin on Request Header

From Dev

Cross-Origin Request Blocked: & Reason: CORS header 'Access-Control-Allow-Origin' missing

From Dev

CORS Security: Set Access-Control-Allow-Origin to Origin on Request Header

From Dev

Cross-Origin Request Blocked: & Reason: CORS header 'Access-Control-Allow-Origin' missing

From Dev

Intermittent Error: Cross-Origin Request Blocked - CORS header ‘Access-Control-Allow-Origin’ missing

From Dev

POST request with SSL to 3rd party API, failing: "Origin http://localhost:5000 is not allowed by Access-Control-Allow-Origin."

From Dev

Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response

From Dev

Request origin not allowed: http://localhost:3001 when using Rails5 and ActionCable

From Dev

CORS 405 (Method Not Allowed)

From Dev

CORS 405 (Method Not Allowed)

From Dev

Vimeo URL from origin has been blocked by CORS policy: Method PATCH is not allowed by Access-Control-Allow-Methods in preflight response

Related Related

  1. 1

    Is CORS request without Origin allowed?

  2. 2

    CORS Origin Request not allowed

  3. 3

    Dealing with Origin http://localhost is not allowed by Access-Control-Allow-Origin Without CORS header

  4. 4

    Dealing with Origin http://localhost is not allowed by Access-Control-Allow-Origin Without CORS header

  5. 5

    CORS - localhost as allowed origin in production

  6. 6

    Why Ajax GET request without CORS is blocked, but JSONP is allowed?

  7. 7

    Cross origin request with CORS filter

  8. 8

    Safari issue with CORS: Origin is not allowed by Access-Control-Allow-Origin

  9. 9

    Origin is not allowed by Access-Control-Allow-Origin without solution

  10. 10

    Request header field Access-Control-Allow-Origin is not allowed

  11. 11

    Cors request method PUT is not allowed by Access-Control-Allow-Methods

  12. 12

    header('Access-Control-Allow-Origin: *'); Not allowing CORS request

  13. 13

    Internet Explorer 11 does not add the Origin header on a CORS request?

  14. 14

    Internet Explorer 11 does not add the Origin header on a CORS request?

  15. 15

    “Origin null is not allowed by Access-Control-Allow-Origin” error for request made by application running from a file:// URL

  16. 16

    Cross-Domain Request without CORS or JSONP

  17. 17

    CORS request not working without chrome plugin

  18. 18

    CORS allowed-origin restrictions aren’t causing the server to reject requests

  19. 19

    CORS Security: Set Access-Control-Allow-Origin to Origin on Request Header

  20. 20

    Cross-Origin Request Blocked: & Reason: CORS header 'Access-Control-Allow-Origin' missing

  21. 21

    CORS Security: Set Access-Control-Allow-Origin to Origin on Request Header

  22. 22

    Cross-Origin Request Blocked: & Reason: CORS header 'Access-Control-Allow-Origin' missing

  23. 23

    Intermittent Error: Cross-Origin Request Blocked - CORS header ‘Access-Control-Allow-Origin’ missing

  24. 24

    POST request with SSL to 3rd party API, failing: "Origin http://localhost:5000 is not allowed by Access-Control-Allow-Origin."

  25. 25

    Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response

  26. 26

    Request origin not allowed: http://localhost:3001 when using Rails5 and ActionCable

  27. 27

    CORS 405 (Method Not Allowed)

  28. 28

    CORS 405 (Method Not Allowed)

  29. 29

    Vimeo URL from origin has been blocked by CORS policy: Method PATCH is not allowed by Access-Control-Allow-Methods in preflight response

HotTag

Archive