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

  • Home
  • SEARCH
  • 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 9068287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:09:21+00:00 2026-06-16T17:09:21+00:00

I know register globals should not be used but cannot quite understand why? For

  • 0

I know register globals should not be used but cannot quite understand why?

For example: this is the code that I find so often to demonstrate the security risk of using register globals while passing something like example.com?authorized=1 to the script:

if (authenticated_user()) 
{ 
$authorized = true; 
} 

if ($authorized) 
{ 
include '/highly/sensitive/data.php'; 
} 

My question is if the user has to pass authorized=1 in the url he should be aware of the variable names that i use in my script, right? How is that possible?

Also isn’t a function like parse_str() which behaves somewhat similar to register globals a security risk too?

  • 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-16T17:09:22+00:00Added an answer on June 16, 2026 at 5:09 pm
    1. The attacker may have access to your source code via another security hole or privacy breach.
    2. The attacker can guess. It’s pretty trivial to build a bot to enumerate all the plausible variables names and try them against thousands of php sites. (?authorized=1, ?login=1, ?access=1, etc.)

    EDIT

    In response to parse_str, it depends what exactly the use case is, but in general probably.
    If parse_str is passed any user provided content, then yes, absolutely it’s unsafe.

    There may be some legitimate use cases for it where the input provided is not user-provided, but in general I’d stay away from it.

    I would also say the same about extract: https://www.php.net/manual/en/function.extract.php

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

Sidebar

Related Questions

I dont know what happend but I cant register any dlls anymore. It seems
I know it's possible to use DependencyResolver and register Castle Windsor with MVC but
I know there exists a command like jQuery.noConflict. But for this it first registers
Know this might be rather basic, but I been trying to figure out how
I know you can not set a key value dynamically, but what about the
I know that Phonegap has an event for back button, but it's only available
I know this is more heavy question, but I think its interesting too. It
I am using the Registry DSL example to configure structuremap. But doing this makes
I know, globals not (; I am new to OOP, and I'm refactoring some
I have register globals on, I know, I know, bad idea, I didn't program

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.