Skip to content

Commit

Permalink
Add privacy/security doc for supporting image/svg (MicrosoftEdge#750)
Browse files Browse the repository at this point in the history
* Add privacy/security doc for supporting image/svg

* Address PR comments.

* Add read/write markup processing.

* Add link to unsanitized list.
  • Loading branch information
snianu authored Feb 10, 2024
1 parent 886968d commit d482115
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions ClipboardAPI/tag-security-privacy-clipboard-svg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
### Questions from https://www.w3.org/TR/security-privacy-questionnaire/

## 2. Questions to Consider

### 2.1. What information might this feature expose to Web sites or other parties, and for what purposes is that exposure necessary?

This feature exposes the `image/svg+xml` MIME type to the clipboard using the async clipboard API to support copy-paste of SVG images. All the restrictions related to secure context, permission etc apply for reading this format. During `write()`, the format is parsed using the `DOMParser` that uses an XML parser to return a well-formed SVG document. During `read()`, `image/svg+xml` is strictly processed by-default using the HTML fragment parser that inlines styles and also strips out security-sensitive tags. If `image/svg+xml` is in the [`unsanitized`](https://w3c.github.io/clipboard-apis/#dom-clipboardunsanitizedformats-unsanitized) list, then it's returned without any processing.

### 2.2. Do features in your specification expose the minimum amount of information necessary to enable their intended uses?

Yes.

### 2.3. How do the features in your specification deal with personal information, personally-identifiable information (PII), or information derived from them?

No PII information is exposed in this new clipboard format support.

### 2.4. How do the features in your specification deal with sensitive information?

This feature doesn't deal with any sensitive information.

### 2.5. Do the features in your specification introduce new state for an origin that persists across browsing sessions?

No.

### 2.6. Do the features in your specification expose information about the underlying platform to origins?

No.

### 2.7. Does this specification allow an origin to send data to the underlying platform?

Yes. This exposes a new `image/svg+xml` MIME type to the clipboard using the existing async clipboard API. The content is processed using the `DOMParser` that uses an XML parser to return a well-formed SVG document before it gets written to the clipboard.

### 2.8. Do features in this specification enable access to device sensors?

No.

### 2.9. Do features in this specification enable new script execution/loading mechanisms?

No.

### 2.10. Do features in this specification allow an origin to access other devices?

No.

### 2.11. Do features in this specification allow an origin some measure of control over a user agent’s native UI?

No.

### 2.12. What temporary identifiers do the features in this specification create or expose to the web?

None.

### 2.13. How does this specification distinguish between behavior in first-party and third-party contexts?

It doesn't distinguish between behavior in first-party and third-party contexts as the async clipboard APIs already have restrictions via Permissions.

### 2.14. How do the features in this specification work in the context of a browser’s Private Browsing or Incognito mode?

It works the same way in incognito mode.

### 2.15. Does this specification have both "Security Considerations" and "Privacy Considerations" sections?

Yes. https://docs.google.com/document/d/1jq8QSCQRdNy99rnPusmW8is62c22PVuq-Sk-tMT2tRk/edit?usp=sharing.

### 2.16. Do features in your specification enable origins to downgrade default security protections?

No.

### 2.17. How does your feature handle non-"fully active" documents?

No interaction with documents regardless of its state. Web authors have to provide the SVG image content via the async clipboard APIs.

### 2.18. What should this questionnaire have asked?

N/A

## 3. Threat Models

### 3.1. Passive Network Attackers

No threat.

### 3.2. Active Network Attackers

The API is only available from a secure context.

### 3.3. Same-Origin Policy Violations

It doesn't leak data across origins.

### 3.4. Third-Party Tracking

No interaction with third-party pages.

### 3.5. Legitimate Misuse

We don't think there is any risk of legitimate misuse of this API. Browser parses the SVG image string provided by the web author before the parsed content is written to the system clipboard. The target apps that reads this data will not be at risk of parsing malformed SVG images.

0 comments on commit d482115

Please sign in to comment.