Using locale-sensitive methods on locale-sensitive data can produce unexpected results when the locale is unspecified. Programming language identifiers, protocol keys, and HTML tags are often specified in a particular locale, usually Locale.ENGLISH
. It may even be possible to bypass input filters by changing the default locale, which can alter the behavior of locale-sensitive methods. For example, when a string is converted to uppercaseupper case, it may be declared valid; however, changing the string back to lower case during subsequent execution may result in a black-listed blacklisted string.
Any program which invokes local-sensitive methods on untrusted data must explicitly specify the locale to use with these methods.
...
Wiki Markup |
---|
This noncompliant code example uses the locale-sensitive {{String.toUpperCase()}} method to convert an HTML tag to uppercaseupper case. While the English locale would convert "title" to "TITLE", the Turkish locale will convert "title" to "T?TLE," where '?' is the Latin capital letter 'I' with a dot above the character \[[API 2006|AA. Bibliography#API 06]\]. |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="9e42ac8e9d61bd57-dfd20a8c-44ee439d-b191818e-35d97bfa811196f8a50fe08a"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] | Class | ]]></ac:plain-text-body></ac:structured-macro> |
...