Fix the BUG. how can I fix it?

Source: Internet
Author: User
Fix the BUG. how can I fix this bug? there are 2 php files

1. php
Echo '1 ';
?>

2. php
Echo '2 ';
?>
Input in the browser
Http: // localhost/1.php/ 2.php

Output 1

In order to save trouble, I want to directly prompt that the browser address is invalid. what should I do?


Reply to discussion (solution)

However, http: // localhost/1.php/ 2.php is not illegal. why is it illegal?
The/2.php file is saved in the $ _ SERVER ['path _ info'] variable.

However, http: // localhost/1.php/ 2.php is not illegal. why is it illegal?
The/2.php file is saved in the $ _ SERVER ['path _ info'] variable.
There is a security risk, because I am working on a foreign online shop system, a similar BUG, can bypass login
Http://www.crehelp.com/cre-loaded-vulnerability-check-you-are-affected-pg-7.html
View the order information directly.
I still don't know how to fix it.

As mentioned above, it is not illegal. However, it is quite easy to implement. get the input url, intercept the file name, and make a simple judgment.

$ Url = "http: // localhost/1.php/ 2.php"; $ filename = basename ($ url); if ($ filename! = "1.php") {echo" script "alert ('invalid address'); script";}

As mentioned above, it is not illegal. However, it is quite easy to implement. get the input url, intercept the file name, and make a simple judgment.

$ Url = "http: // localhost/1.php/ 2.php"; $ filename = basename ($ url); if ($ filename! = "1.php") {echo" script "alert ('invalid address'); script";}

This is a method, but the file volume is too large and there are too many background files. you can view the information of every file to bypass logon.

It is not clear what is used. it is recommended to create an anti-hop wall, with a single portal

PS: Close, score too low

How to verify if website is vulnerable?If, for example, you use http://www.example.com/admin/ URL to access store admin, try to open http://www.example.com/admin/orders.php/login.php. If you will not see login screen you are in danger!
How can I verify that a website is vulnerable?

If, for example, you use. If you do not see the logon screen, you are in danger!

What I see is:

Am I in danger?
Joke!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.