Security issues that may be referenced when comparing php characters with double equals

Source: Internet
Author: User

Title party !, The article is short. Haha! I studied php before. Php automatically performs similar conversions. This is a feature of php, not known as 0-day,

Perl.

Directly cutting the text, everyone who learns php knows the difference between "=" and "=". The former will automatically change the type when comparing different types of variables, the latter detects

Whether the variable types are consistent.

Var_dump (boolean) ""); // false
Var_dump (boolean) ''); // false
Var_dump (boolean) '0'); // false
Var_dump (boolean) '0. 0'); // true
Var_dump (boolean) 0.0); // false
Var_dump (boolean) array (); // false
// Var_dump (boolean) bar); // php 4.0
Var_dump (boolean) null); // null variable
// Var_dump (boolean) $ bar); // false

Var_dump (boolean) 0 = 1); // false
Var_dump (1 = 'bar'); // false
Var_dump (0 = 'bar'); // true
Var_dump (0 = 'bar'); // false
?>

In some cases, this small detail may cause security problems. For example, an identity bypass vulnerability in mysql, DZ XSS

Http://sebug.net/vuldb/ssvid-60198


First:

 

Let's take a look at an XSS of DZ 6.
 

If (! Empty ($ listgid) & ($ listgid = intval ($ _ GET ['listgid']) {// here, we use [=] instead of [=] For comparison, and $ listgid is not initialized :) $ type = $ adminid = 1? 'Grouplist': $ type;} else {$ listgid = ";}... $ Multipage = multi ($ num, $ memberperpage, $ page, "member. php? Action = list & listgid = $ listgid & srchmem = ". rawurlencode ($ srchmem)." & order = $ order & type = $ type ", $ membermaxpages );





$ Listgid = intval ($ _ GET ['listgid']) // true
We recommend that you use ===$ val ===$ val1 & return true;


 

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.