-
-
Notifications
You must be signed in to change notification settings - Fork 36
Add security considerations section #588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# DRAFT Appendices | ||
|
||
## Security Considerations | ||
|
||
MessageFormat 2.0 _patterns_ are meant to allow a _message_ to include any string value | ||
which users might normally wish to use in their environment. | ||
Programming languages and other environments vary in what characters are permitted | ||
to appear in a valid string. | ||
In many cases, certain types of characters, such as invisible control characters, | ||
require escaping by these host formats. | ||
In other cases, strings are not permitted to contain certain characters at all. | ||
Since _messages_ are subject to the restrictions and limitations of their | ||
host environments, their serializations and resource formats, | ||
that might be sufficient to prevent most problems. | ||
However, MessageFormat itself does not supply such a restriction. | ||
|
||
MessageFormat _messages_ permit nearly all Unicode code points, | ||
with the exception of surrogates, | ||
to appear in _literals_, including the text portions of a _pattern_. | ||
This means that it can be possible for a _message_ to contain invisible characters | ||
(such as bidirectional controls, | ||
ASCII control characters in the range U+0000 to U+001F, | ||
or characters that might be interpreted as escapes or syntax in the host format) | ||
that abnormally affect the display of the _message_ | ||
when viewed as source code, or in resource formats or translation tools, | ||
but do not generate errors from MessageFormat parsers or processing APIs. | ||
|
||
Bidirectional text containing right-to-left characters (such as used for Arabic or Hebrew) | ||
also poses a potential source of confusion for users. | ||
Since MessageFormat 2.0's syntax makes use of | ||
keywords and symbols that are left-to-right or consist of neutral characters | ||
(including characters subject to mirroring under the Unicode Bidirectional Algorithm), | ||
it is possible to create messages that, | ||
when displayed in source code, or in resource formats or translation tools, | ||
have a misleading appearance or are difficult to parse visually. | ||
|
||
For more information, see \[[UTS#55](https://unicode.org/reports/tr55/)\] | ||
<cite>Unicode Source Code Handling</cite>. | ||
|
||
MessageFormat 2.0 implementations might allow end-users to install | ||
_selectors_, _functions_, or _markup_ from third-party sources. | ||
Such functionality can be a vector for various exploits, | ||
including buffer overflow, code injection, user tracking, | ||
fingerprinting, and other types of bad behavior. | ||
Any installed code needs to be appropriately sandboxed. | ||
In addition, end-users need to be aware of the risks involved. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to separate 2 cases: what the MF message appears like to the programmer, vs what a resulting message appears like to the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text refers specifically to viewing the message in a source code context (and thus UTS55 is relevant).
That reminds me that there is probably the need to call out another security consideration, which is that the output of formatting needs to be examined for e.g. injection or other abuse.