Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7707035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:15:31+00:00 2026-06-01T00:15:31+00:00

Background: I am creating a REST api, that will require users to use only

  • 0

Background:
I am creating a REST api, that will require users to use only a JavaScript file, for that I made an ajax request that gets data from the server.
in order to do that I wrote the following like in php:

Access-Control-Allow-Origin: *

I have a few questions:
1) What is the security hole that is present if I open the ability of other domains to interact with me?
(Access-Control-Allow-Origin: *)
2) What should I do to secure it?
3) Does this “Allow-Origin” work in all browsers? (mobile…) – or it does not matter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:15:33+00:00Added an answer on June 1, 2026 at 12:15 am

    If you use the wildcard, that means any domain can make a cross domain request to your domain and get the page. For example, say you are logged into your GMail account. Naturally, when you open up a window to http://gmail.com, you will instantly see your emails and messages (there’s some redirection happening, but let’s assume not for the sake of the example and simplicity).

    Well if I make a website (be it anything) and I manage to get you on that website, or alternatively, I manage to modify a website that you frequently go on, I could make an AJAX request to GMail, and if GMail had Allow-Origin: * and you were logged in, the AJAX request would return the HTML of the page that is usually shown to you; the list of your emails. At worst I get a list of all your emails and the persons you sent them to, at best I can also manipulate the requests and get a lot more information.

    I wouldn’t use a wildcard if I were you; I would use some sort of list of trusted domains.

    The Allow Origin is enforced server side. As for cross origin AJAX support, it is supported in most browsers. For older versions of IE, you have to use a different object to make the requests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a new REST-ful API who's primary/only consumer will be a smart/non-web-browser
Background: I'm creating a basic download centre on a concurrent server. I create file
BACKGROUND I'm creating an AJAX chat system. It looks something like this: Mike -
Background: I'm creating a toolkit of custom components that extend current components functionality, layout,
Background: I am creating a method addAll that adds all of the values passed
Background: I'm creating a dashboard as a project and I have a query that
A little background: I'm creating a set of adapters to allow communication with mobile
I am creating a simple gradient background by drawing a quad as follows: glMatrixMode
I creating a program which send newsletter with a background image. It works fine
Background Right now, I'm creating a multiple-predictor linear model and generating diagnostic plots to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.