The product uses the wrong operator when comparing a string, such as using "==" when the .equals() method should be used instead.
In Java, using == or != to compare two strings for equality actually compares two objects for equality rather than their string values for equality. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, the unintended comparison result could be leveraged to affect program security.
Impact: Other
Effectiveness: High
javajava(i === s1) is FALSE
(s4 === i) is FALSE
(s4 === s1) is FALSE
var i = 65; var s1 = '65'; var s4 = new String('65');
if (i === s1) {
javascript(i == s1) is FALSE
(s4 == i) is FALSE
(s4 == s1) is FALSE
var i = 65; var s1 = '65'; var s4 = new String('65');
if (i == s1) {
javascriptvar $i = 65; var $s1 = "65";
if ($i === $s1) {
phpvar $i = 65; var $s1 = "65";
if ($i == $s1) {
php