Common Weakness Enumeration

    CWE Definition / CWE-597

    CWE-597: Use of Wrong Operator in String Comparison

    The product uses the wrong operator when comparing a string, such as using == when the .equals() method should be used instead.

    Published:15 Dec 2006
    Organization:MITRE
    Modified:11 Dec 2025

    Related Weakness

    CWE-595: Comparison of Object References Instead of Object Contents

    CWE-595: Comparison of Object References Instead of Object Contents

    CWE-480: Use of Incorrect Operator