Skip to content
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

Move section on code injection to security considerations. #1463

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 48 additions & 39 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6357,6 +6357,54 @@ <h4>Inappropriate Use</h4>
specific context of their intended application.
</p>
</section>

<section class="informative">
<h3>Code Injection</h3>

<p>
It is possible to include data in [=verifiable credentials=] that include
msporny marked this conversation as resolved.
Show resolved Hide resolved
executable code or scripting languages. Authors of verifiable credentials are
advised to avoid doing so, unless necessary, and the risks have been mitigated
to the extent possible.
</p>

<p>
For example, when a single natural language string contains multiple languages
or annotations, the contents of the string might require additional structure or
markup in order to be presented correctly. It is possible to use markup
languages, such as HTML, to label spans of text in different languages or to
supply string-internal markup needed for proper display of [=bidirectional
msporny marked this conversation as resolved.
Show resolved Hide resolved
text=]. It is also possible to use the `rdf:HTML` datatype to encode such values
accurately in JSON-LD.
</p>

<p>
Despite the ability to encode information as HTML, implementers are strongly
discouraged from doing this because it:
</p>

<ul>
<li>
Requires some version of an HTML processor, which increases the burden of
processing language and base direction information.
</li>
<li>
Increases the security attack surface when utilizing this data model because
naively processing HTML could result in executing a `script` tag that
an attacker injected at some point during the data production process.
msporny marked this conversation as resolved.
Show resolved Hide resolved
</li>
</ul>

<p>
If implementers feel they need to use HTML, or other markup languages capable of
containing executable scripts, to address a specific use case, they are advised
to analyze how an attacker would use the markup to mount injection attacks
against a consumer of the markup and then deploy mitigations against the
identified attacks such as running the HTML rendering engine in a sandbox with
no ability to have access to the network.
msporny marked this conversation as resolved.
Show resolved Hide resolved
</p>
</section>

</section>

<section class="informative">
Expand Down Expand Up @@ -6539,45 +6587,6 @@ <h3>Providing Default Language and Direction</h3>
</p>
</section>

<section class="informative">
<h3>Complex Language Markup</h3>

<p>
When a single natural language string contains multiple languages or
annotations, the contents of the string might require additional structure or
markup in order to be presented correctly. It is possible to use markup
languages, such as HTML, to label spans of text in different languages or to
supply string-internal markup needed for proper display of [=bidirectional
text=]. It is also possible to use the `rdf:HTML` datatype to
encode such values accurately in JSON-LD.
</p>

<p>
Despite the ability to encode information as HTML, implementers are strongly
discouraged from doing this because it:
</p>

<ul>
<li>
Requires some version of an HTML processor, which increases the burden of
processing language and base direction information.
</li>
<li>
Increases the security attack surface when utilizing this data model because
blindly processing HTML could result in executing a `script` tag that
an attacker injected at some point during the data production process.
</li>
</ul>

<p>
If implementers feel they must use HTML, or other markup languages capable of
containing executable scripts, to address a specific use case, they are advised
to analyze how an attacker would use the markup to mount injection attacks
against a consumer of the markup and then deploy mitigations against the
identified attacks.
</p>
</section>

</section>

<section class="appendix informative">
Expand Down