tc39 / proposal-array-is-template-object

TC39 proposal to identify tagged template string array objects
https://tc39.es/proposal-array-is-template-object/
MIT License
44 stars 7 forks source link

Add practical example to explainer. #13

Closed mikesamuel closed 3 years ago

mikesamuel commented 4 years ago

Fix #12

This does not meet @gibson042's requirement:

but does not demonstrate any use case in which a potential attacker has the ability to provide arguments to a sensitiveOperation function

but as explained on the issue, I think that's the wrong standard.

If we can assume some mechanism to solve provisioning, getting a sensitiveOperation to a tag function without providing it to all the tag function's potential callers, then an unbypassable isTemplateObject check can provide value.

Trusted Types has provisioning machinery, so the example uses that.

mikesamuel commented 4 years ago

@gibson042 @bathos @jridgewell

I put together an example.

I've done some other work on tag functions that mark their output as trusted based on assumptions about the provenance of tag template inputs include:

Those are based on the outcome of the "Node Security Roadmap" discussion of Structured Strings

bathos commented 4 years ago

The comment-walkthrough is great imo.