Skip to content

Commit 38dd556

Browse files
authored
Add TAG security/privacy questionnaire for yield() (#69)
1 parent 9252066 commit 38dd556

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

explainers/yield-and-continuation.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- [Priorities on `fetch()` and Other Async Tasks](#priorities-on-fetch-and-other-async-tasks)
4343
- [Stakeholder Feedback / Opposition](#stakeholder-feedback--opposition)
4444
- [References & Acknowledgements](#references--acknowledgements)
45+
- [Self-Review Questionnaire: Security and Privacy](#self-review-questionnaire-security-and-privacy)
4546
- [Appendix](#appendix)
4647
- [Event Loop Scheduling](#event-loop-scheduling)
4748

@@ -652,6 +653,120 @@ Many thanks for valuable feedback and advice from:
652653
[@philipwalton](https://github.com/philipwalton), and
653654
[@tdresser](https://github.com/tdresser).
654655
656+
657+
## [Self-Review Questionnaire: Security and Privacy](https://w3ctag.github.io/security-questionnaire/)
658+
659+
> 01. What information does this feature expose, and for what purposes?
660+
661+
This API does not directly expose any information — it only provides a way
662+
to yield from the current task and resume in a new task. But like other
663+
scheduling APIs (prioritized or otherwise), some information about an origin's
664+
tasks might be learned by another origin sharing the _same thread_. An origin
665+
could flood the system with continuations, e.g. by calling `scheduler.yield()`
666+
in a loop or many times consecutively and measuring delay. The malicious origin
667+
would learn that the UA either chose something else to run or throttled it, and
668+
might try to infer what ran, e.g. input, rendering, high priority task,
669+
continuation, etc.
670+
671+
See [Monitoring Another Origin's
672+
Tasks](https://wicg.github.io/scheduling-apis/#sec-security-monitoring-tasks)
673+
for more detail and possible mitigations.
674+
675+
> 02. Do features in your specification expose the minimum amount of information
676+
> necessary to implement the intended functionality?
677+
678+
Yes.
679+
680+
> 03. Do the features in your specification expose personal information,
681+
> personally-identifiable information (PII), or information derived from
682+
> either?
683+
684+
No.
685+
686+
> 04. How do the features in your specification deal with sensitive information?
687+
688+
The feature does not interact with sensitive information.
689+
690+
> 05. Do the features in your specification introduce state
691+
> that persists across browsing sessions?
692+
693+
No.
694+
695+
> 06. Do the features in your specification expose information about the
696+
> underlying platform to origins?
697+
698+
No.
699+
700+
> 07. Does this specification allow an origin to send data to the underlying
701+
> platform?
702+
703+
No.
704+
705+
> 08. Do features in this specification enable access to device sensors?
706+
707+
No.
708+
709+
> 09. Do features in this specification enable new script execution/loading
710+
> mechanisms?
711+
712+
No, the API is used within existing script execution mechanisms.
713+
714+
> 10. Do features in this specification allow an origin to access other devices?
715+
716+
No.
717+
718+
> 11. Do features in this specification allow an origin some measure of control over
719+
> a user agent's native UI?
720+
721+
No.
722+
723+
> 12. What temporary identifiers do the features in this specification create or
724+
> expose to the web?
725+
726+
None.
727+
728+
> 13. How does this specification distinguish between behavior in first-party and
729+
> third-party contexts?
730+
731+
It does not make a distinction.
732+
733+
> 14. How do the features in this specification work in the context of a browser’s
734+
> Private Browsing or Incognito mode?
735+
736+
No distinction is made; they work the same.
737+
738+
> 15. Does this specification have both "Security Considerations" and "Privacy
739+
> Considerations" sections?
740+
741+
This API will be specified in [Prioritized Task Scheduling](https://w3ctag.github.io/security-questionnaire/),
742+
which has [security](https://wicg.github.io/scheduling-apis/#sec-security)
743+
and [privacy](https://wicg.github.io/scheduling-apis/#sec-privacy)
744+
considerations sections relevant to this API, particularly the section about
745+
[Monitoring another Origin's tasks](https://wicg.github.io/scheduling-apis/#sec-security-monitoring-tasks).
746+
The relevant sections will be updated to reflect the new API.
747+
748+
> 16. Do features in your specification enable origins to downgrade default
749+
> security protections?
750+
751+
No.
752+
753+
> 17. What happens when a document that uses your feature is kept alive in BFCache
754+
> (instead of getting destroyed) after navigation, and potentially gets reused
755+
> on future navigations back to the document?
756+
757+
The feature will resume working. `yield()` continuations will be implemented as
758+
HTML tasks, and BFCache behavior is inherited from how the event loop works
759+
(tasks stop running in BFCache and resume if reused).
760+
761+
> 18. What happens when a document that uses your feature gets disconnected?
762+
763+
The feature stops working when a document is detached. The event loops stops
764+
running tasks for detached documents, so any unresolved promises will not be
765+
resolved or rejected. Calls to `scheduler.yield()` on a `scheduler` whose
766+
document is detached will return a rejected promise.
767+
768+
> 19. What should this questionnaire have asked?
769+
655770
## Appendix
656771
657772
### Event Loop Scheduling

0 commit comments

Comments
 (0)