Closed mikesamuel closed 4 years ago
@mikesamuel can you clarify
If github.com/wicg/trusted-types defines a TrustedModuleSpecifier type then new AssetReference(...) should not stringify the value assigned to its [AssetSpecifier] internal slot
If the value in the TrustedModuleSpecifier is downgraded to not be trusted (since it becomes a string), what is the problem? Are TrustedModuleSpecifiers not expected to have a URL based location on the web?
It seems to me that the specifier shouldn't necessarily be a TrustedModuleSpecifier. Instead, it is the whole AssetReference that is trusted. The tuple would be of a trusted type.
Although I'm not sure Asset References should necessarily automatically be trusted because they're static. A policy can prevent a particular url or path to be disallowed from a particular subgraph even if the path to it is statically specified. To avoid mistakes of taking on insecure dependencies.
For this to work the Asset References need some way to attain a policy that they produce trusted values from.
@sebmarkbage if we are talking policies, there are a lot of other things a policy might wish to embed other than just if a specifier is allowed to be resolved (final path / integrity+MIME of resource body / etc.). It might be better to just say this is all host meta-data and leave it up to policy from the host to determine the right data to include.
Sorry for taking so long to respond.
If the value in the TrustedModuleSpecifier is downgraded to not be trusted (since it becomes a string), what is the problem?
That fails safe w.r.t. integrity but not availability; if a properly made trust decision is not respected, then it's harder to convince teams to adopt measures that make trust decisions explicit and auditable.
It seems to me that the specifier shouldn't necessarily be a TrustedModuleSpecifier. Instead, it is the whole AssetReference that is trusted. The tuple would be of a trusted type.
Fair enough.
I think issue #3 and issue #4 cover the main points.
+@bmeck +@sebmarkbage
Per feedback from the last in-person meeting:
this proposal may overlap with asset references.
Off the top of my head, points of overlap include:
new AssetReference(...)
should not stringify the value assigned to its[AssetSpecifier]
internal slot.