Same-origin policy with local Host recordAccess-Control-Allow-Origin Multiple Origin Domains?Why doesn't adding CORS headers to an OPTIONS route allow browsers to access my API?How does Access-Control-Allow-Origin header work?Same origin Policy and CORS (Cross-origin resource sharing)Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?Disable Spring Security for OPTIONS Http MethodUsefulness of Same Origin Policy with CORSsame-origin policy and CORS - what's the point?Why Same-origin policy isn't enough to prevent CSRF attacks?Same Origin Policy is browser restriction, is it secure on server-side?

How come having a Deathly Hallow is not a big deal?

Blood-based alcohol for vampires?

Isn't "Dave's protocol" good if only the database, and not the code, is leaked?

Can you use a reaction to affect initiative rolls?

Bootstrap paradox with a time machine in iron

SQL Server error 242 with ANSI datetime

List of Implementations for common OR problems

Should I cheat if the majority does it?

Should I hide my travel history to the UK when I apply for an Australian visa?

what is the meaning of "stock" dilution on the Massive Dev Chart Website?

Should I warn my boss I might take sick leave

Sleepy tired vs physically tired

How frequently do Russian people still refer to others by their patronymic (отчество)?

How to widen the page

Why would a propellor have blades of different lengths?

How is /a/ pronounced before n/m in French?

Are there advantages in writing by hand over typing out a story?

What is the right way to query an I2C device from an interrupt service routine?

What is a "tittering order"?

What can a novel do that film and TV cannot?

Which are more efficient in putting out wildfires: planes or helicopters?

Is it possible to spoof an IP address to an exact number?

Story about two rival crews terraforming a planet

When should we use dependency injection (C#)



Same-origin policy with local Host record


Access-Control-Allow-Origin Multiple Origin Domains?Why doesn't adding CORS headers to an OPTIONS route allow browsers to access my API?How does Access-Control-Allow-Origin header work?Same origin Policy and CORS (Cross-origin resource sharing)Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?Disable Spring Security for OPTIONS Http MethodUsefulness of Same Origin Policy with CORSsame-origin policy and CORS - what's the point?Why Same-origin policy isn't enough to prevent CSRF attacks?Same Origin Policy is browser restriction, is it secure on server-side?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a REST service that I want to secure with CORS. The client application is provided by domain.com and the REST service is domain.com/service.



The REST service filters out request depending on the origin header or an authentication token. This is the required behavior.



The problem is coming when the user insert a local DNS record(Host file in Windows) for domain.com and loads the malicious code from a local machine. In this case the browser will send the request with the Origin header set to domain.com. This will bypass the Origin check that we have in place. How can we handle this issue?










share|improve this question






























    0















    I have a REST service that I want to secure with CORS. The client application is provided by domain.com and the REST service is domain.com/service.



    The REST service filters out request depending on the origin header or an authentication token. This is the required behavior.



    The problem is coming when the user insert a local DNS record(Host file in Windows) for domain.com and loads the malicious code from a local machine. In this case the browser will send the request with the Origin header set to domain.com. This will bypass the Origin check that we have in place. How can we handle this issue?










    share|improve this question


























      0












      0








      0


      0






      I have a REST service that I want to secure with CORS. The client application is provided by domain.com and the REST service is domain.com/service.



      The REST service filters out request depending on the origin header or an authentication token. This is the required behavior.



      The problem is coming when the user insert a local DNS record(Host file in Windows) for domain.com and loads the malicious code from a local machine. In this case the browser will send the request with the Origin header set to domain.com. This will bypass the Origin check that we have in place. How can we handle this issue?










      share|improve this question
















      I have a REST service that I want to secure with CORS. The client application is provided by domain.com and the REST service is domain.com/service.



      The REST service filters out request depending on the origin header or an authentication token. This is the required behavior.



      The problem is coming when the user insert a local DNS record(Host file in Windows) for domain.com and loads the malicious code from a local machine. In this case the browser will send the request with the Origin header set to domain.com. This will bypass the Origin check that we have in place. How can we handle this issue?







      http cors same-origin-policy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 25 at 17:52







      Dimitar Pavlov

















      asked Mar 25 at 17:45









      Dimitar PavlovDimitar Pavlov

      1902 silver badges9 bronze badges




      1902 silver badges9 bronze badges






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343720%2fsame-origin-policy-with-local-host-record%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343720%2fsame-origin-policy-with-local-host-record%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현