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

Description

Improper Handling of Unicode Encoding

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.

Configuration

This detector does not need any configuration.

References

© 2026 Xygeni. All rights reserved