rfc-7564

PRECIS Framework: Preparation, Enforcement, and Comparison of Internationalized Strings in Application Protocols

P. Saint-Andre, M. Blanchet
date2015-05 streamIETF areaart wgprecis statusPROPOSED STANDARD pages40 canonicalhttps://www.rfc-editor.org/rfc/rfc7564 doi10.17487/RFC7564 errataview
Application protocols using Unicode characters in protocol strings need to properly handle such strings in order to enforce internationalization rules for strings placed in various protocol slots (such as addresses and identifiers) and to perform valid comparison operations (e.g., for purposes of authentication or authorization). This document defines a framework enabling application protocols to perform the preparation, enforcement, and comparison of internationalized strings ("PRECIS") in a way that depends on the properties of Unicode characters and thus is agile with respect to versions of Unicode. As a result, this framework provides a more sustainable approach to the handling of internationalized strings than the previous framework, known as Stringprep (RFC 3454). This document obsoletes RFC 3454.

obsoleted by

obsoletes

Extracted elements (30)

design-rationale §1

PRECIS uses an 'inclusion model' in which a string class consists only of code points that are explicitly allowed; any code point not explicitly allowed is forbidden. This contrasts with an exclusion model and provides a more predictable security posture.

security

design-rationale §5.3

Spaces are excluded from the IdentifierClass because many Unicode characters are visually confusable with ASCII space, space characters are often not rendered in UIs, and some devices emit non-ASCII space equivalents (e.g., U+200D) on a spacebar press. The working group considered this a feature rather than a limitation.

security

design-rationale §1

Stringprep (RFC 3454) was tied to Unicode version 3.2, making it impossible to be agile with respect to new Unicode versions. PRECIS replaces Stringprep by defining string classes in terms of Unicode code point properties and a derivation algorithm, allowing it to apply to any future Unicode version without republication.

security, privacy

design-rationale §4.1

The community concluded that most use cases are addressed by exactly two string classes—IdentifierClass (safety over expressiveness) and FreeformClass (expressiveness over safety)—rather than one per application protocol, in order to enable code sharing and consistent user expectations.

interoperability-note §13.3

Changes to Unicode code point properties between versions can alter derived property values, potentially causing different behavior across implementations running different Unicode versions. Implementers should be aware that treatment of certain characters may differ between Unicode 5.2, 7.0, and future versions.

interoperability-note §13.1

The PRECIS framework does not mandate a specific wire encoding; UTF-8 is commonly used but the exact encoding is the application protocol's responsibility. Systems unable to support the full Unicode character set must establish a common baseline coded character set at the application layer.

normative-requirement §8 MUST NOT

A character with the derived property value CONTEXTJ or CONTEXTO MUST NOT be used unless an appropriate contextual rule has been established and the context of the character is consistent with that rule.

normative-requirement §5 MUST NOT

A profile MUST NOT add as valid any code points that are disallowed by the relevant PRECIS string class; it may only further restrict the allowed set.

normative-requirement §12.5 SHOULD

An application service SHOULD define a policy restricting which scripts or character blocks may be registered or stored, and SHOULD forbid strings that mix characters from more than one script, to reduce confusable-character attacks.

security

normative-requirement §5.2.3 RECOMMENDED

If case mapping is desired, it is RECOMMENDED to use Unicode Default Case Folding. It is NOT RECOMMENDED to map uppercase/titlecase to lowercase for strings used as passwords; instead, case-sensitive comparison with preserved case is RECOMMENDED.

security

normative-requirement §8 MUST NOT

Implementations MUST NOT modify the order of operations within the derived property calculation algorithm, since doing so would cause inconsistent results across implementations.

normative-requirement §12.6 RECOMMENDED

It is NOT RECOMMENDED for application protocols to profile the FreeformClass for passwords in a way that removes entire categories (e.g., symbols or punctuation), since this reduces entropy. Case-sensitive comparison is RECOMMENDED for password strings.

security

normative-requirement §5.2.5 SHOULD

Profile authors who consider defining a new directionality rule are strongly discouraged from doing so; they SHOULD instead use the Bidi Rule (RFC 5893) for IdentifierClass-based profiles or follow the Unicode bidirectional algorithm (UAX9) for FreeformClass-based profiles.

normative-requirement §7 MUST

Rules for a PRECIS string class or profile MUST be applied in the following fixed order: (1) Width Mapping, (2) Additional Mapping, (3) Case Mapping, (4) Normalization, (5) Directionality, (6) Behavioral rules (valid/contextual/disallowed/unassigned).

normative-requirement §5.2.4 RECOMMENDED

Unicode normalization form C (NFC) is RECOMMENDED for the normalization rule of a profile, in accordance with RFC 5198.

normative-requirement §5.2.1 RECOMMENDED

Width mapping is RECOMMENDED when NFC normalization is used (as opposed to NFKD/NFKC), because allowing fullwidth and halfwidth characters to remain unmapped to their compatibility variants would violate the Principle of Least Astonishment.

protocol-element §5

A PRECIS profile MUST specify: width mapping rule, additional mapping rule, case mapping rule, normalization rule, and directionality rule. It MAY further restrict allowable characters but MUST NOT add code points disallowed by the base string class.

protocol-element §4.3

FreeformClass allows LetterDigits (A), OtherLetterDigits (R), ASCII7 (K), HasCompat (Q), Spaces (N), Symbols (O), and Punctuation (P) as valid; Exceptions and JoinControl are allowed under contextual rules; OldHangulJamo, Controls, and PrecisIgnorableProperties are disallowed. Unassigned code points are disallowed.

protocol-element §4.2

IdentifierClass allows LetterDigits (A), printable ASCII7 U+0021–U+007E (K), and Exceptions/JoinControl under contextual rules; it disallows OldHangulJamo, Controls, PrecisIgnorableProperties, Spaces, Symbols, Punctuation, HasCompat, and OtherLetterDigits. Unassigned code points are treated as disallowed.

protocol-element §3

PRECIS defines three actions: Preparation (ensuring characters are allowed by the string class), Enforcement (applying all rules of a profile to determine if a string can be used in a protocol slot), and Comparison (applying rules to two strings to determine equivalence). Servers are responsible for enforcement; clients for preparation.

protocol-element §9.11

The ASCII7 (K) category grandfathers all printable non-space 7-bit ASCII code points (U+0021–U+007E) as PVALID, exempting them from other rules on the assumption that disallowing them would be counter-productive given their ubiquity.

protocol-element §8

The derived property calculation algorithm checks code points in a strict priority order: Exceptions → BackwardCompatible → Unassigned → ASCII7 → JoinControl → OldHangulJamo → PrecisIgnorableProperties → Controls → HasCompat → LetterDigits → OtherLetterDigits → Spaces → Symbols → Punctuation → DISALLOWED.

protocol-element §8

The PRECIS derived property values are: PVALID (valid in any string class), FREE_PVAL / ID_PVAL (class-specific valid), CONTEXTJ / CONTEXTO (contextual rule required), DISALLOWED (not permitted in any class), and UNASSIGNED (not yet designated in Unicode). These values drive the per-class behavioral rules.

registry §11.2

IANA created the 'PRECIS Base Classes' registry with registration policy 'RFC Required'. Initial entries are IdentifierClass (Section 4.2) and FreeformClass (Section 4.3) of RFC 7564.

registry

registry §11.3

IANA created the 'PRECIS Profiles' registry with registration policy 'Expert Review'. Each entry must specify: Name, Base Class, Applicability, Replaces (old Stringprep profile), Width Mapping Rule, Additional Mapping Rule, Case Mapping Rule, Normalization Rule, Directionality Rule, Enforcement, and Specification.

registry

registry §11.1

IANA maintains the 'PRECIS Derived Property Value' registry, recording derived property values for Unicode versions 7.0 and later. Changes to the rules in Sections 8 and 9 require IETF Review; backward-incompatible table changes must be reported to the IESG.

registry

security-consideration §12.1

False positives and false negatives in string comparison can compromise authentication and authorization. If strings that appear identical to users are programmatically distinct across systems, or vice versa, security vulnerabilities arise. Profile proliferation exacerbates this risk.

security

security-consideration §12.3

The FreeformClass allows virtually any Unicode character, making it highly expressive but hazardous. Protocol designers are warned about code points they may not understand and are encouraged to profile the IdentifierClass wherever feasible, or to restrict FreeformClass profiles as tightly as possible.

security

security-consideration §12.5

Visually similar (confusable) characters can be used to impersonate identifiers—e.g., Cherokee block characters resembling ASCII 'STPETER'. PRECIS does not prohibit confusables because there is no comprehensive technical solution; application protocols are strongly encouraged to define script-restriction policies and warn users about mixed-script strings.

security

security-consideration §12.6

When passwords are input to a cryptographic algorithm (e.g., a hash), the client must perform proper PRECIS preparation before applying the algorithm, since the server does not receive the password in plaintext and cannot re-enforce the profile.

security, crypto