Improper Handling of Unicode Encoding
ID |
scala.strings.scala_strings_rule_improperunicode |
Severity |
high |
Remediation Complexity |
medium |
Remediation Risk |
medium |
Remediation Effort |
medium |
Resource |
Strings |
Language |
Scala |
Rationale
Improper Handling of Unicode Encoding
The following code illustrates a vulnerable pattern detected by this rule:
// Case mapping and IDNA are not one-to-one, so two different strings can become the same
// one here - which is how a check on the mapped value passes for the wrong input.
class AccountNameChecks {
def upperThenEquals(name: String) = {
// VULNERABLE: Improper Handling of Unicode Encoding
name.toUpperCase().equals("ADMIN")
}
}
Remediation
Follow secure coding practices and review the references below for detailed remediation guidance.
References
-
OWASP Top 10 2025 - A05 : Injection.