PHP intval () function vulnerability, is_numeric () vulnerability, bypass palindrome judgment

Source: Internet
Author: User

intval function Gets the integer value of the variable
The maximum value of intval depends on the operating system. The 32-bit system maximum signed integer range is 2147483648 to 2147483647. For example, on such a system, intval (' 1000000000000 ') returns 2147483647. On a 64-bit system, the maximum signed integer value is 9223372036854775807.

This has an application is to judge the value is not a palindrome, if the parameter is 2147483647, then when it is in turn, because the limit is exceeded, so it is still equal to 2147483647. That is a palindrome.

is_numeric () Determines whether a variable is a numeric or numeric string, not only checking 10 binary,16 binary is possible.

The Is_numeric function can be judged as a non-numeric value for the null character,% 00, either before or after the%00, and the%20 space character can only be placed after the value. Therefore, the view function discovers that the function pairs for the first space character will skip the space character judgment, then the subsequent judgment!

The function can also cause SQL injection, such as converting ' 1 or 1 ' to 16 binary, and then the SQL injection

intval ($req ["number"]) =intval (Strrev ($req [" number"])) if the requirement is not a palindrome, but satisfies this condition, it can be constructed with scientific notation 0=0:number= 0e-0%00

PHP intval () function vulnerability, is_numeric () vulnerability, bypass palindrome judgment

Related Article

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.