-
Notifications
You must be signed in to change notification settings - Fork 73
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
Consider removing getPolicyNames() #235
Comments
That would only work if the code runs within the environment where I'm worried that removing this only gives the impression of security. Policy name is not designed to be a secret. Protecting secrets from Javascript code that runs in your realm is at least tricky, so we're trying not to go that way. For example, even if we removed In general, I'd like to stress out not to use policy names as the sole security controls - these are hints that let the app owner simplify the trust decisions, but they are not sufficient measures to stop authors determined to bypass the restrictions. With additional tooling names can be used in a mode that provides more security (e.g. when controlling what gets compiled into the application), but even that this will fall apart when dealing with malicious authors.
so there is some value to it when compared to e.g. events. |
/ cc @xtofian |
I see your point about not giving the impression that policy names are
secret. At the same time, it probably does matter in practice how easy a
measure is worked around.
Essentially, the purpose of these controls is not to strictly prevent a
malicious developer from doing something nefarious, but rather to
reasonably convincingly communicate to a non-malicious developer that
they're doing something they shouldn't.
In that light, a measure that can be worked around with a simple
incantation such as
`trustedTypes.createPolicy(trustedTypes.getPolicyNames()[0], {...})` is
less convincing than something that requires workarounds involving event
handlers or re-fetching JS and using regexen to parse policy names out of
that.
…On Mon, Nov 11, 2019 at 7:26 AM Krzysztof Kotowicz ***@***.***> wrote:
/ cc @xtofian <https://github.com/xtofian>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#235>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAPNDWHHD3TBOFLDQEHBATQTF2RDANCNFSM4JKVCR6A>
.
|
That's opinionated, but for me it is already pretty clear that if there's an allowlist for getting access to some resource, then pretending you're on the allowlist is an intentional bypass - and if that's the intention, then all bets are off. An abuse of the API is indeed easier with The policy name getter can always be constructed, even wrapped in a single function. e.g. In general, I'm worried it might be limiting for the future extension of the API if we decide to make it hard, or impossible to get the policy names from within the program. E.g. it might (in future) be helpful if a trusted type, or DOM attribute getter gave you information about which policy was used to create it. That said, if we think |
A proper introspection at policy creation time (possibly via events) will be created at a later point. Fixes w3c#235.
We removed |
Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72
Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089651 Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Auto-Submit: Krzysztof Kotowicz <koto@google.com> Cr-Commit-Position: refs/heads/master@{#747250}
Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089651 Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Auto-Submit: Krzysztof Kotowicz <koto@google.com> Cr-Commit-Position: refs/heads/master@{#747250}
Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089651 Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Auto-Submit: Krzysztof Kotowicz <koto@google.com> Cr-Commit-Position: refs/heads/master@{#747250}
…PolicyNames()., a=testonly Automatic update from web-platform-tests [Trusted Types] Removed trustedTypes.getPolicyNames(). Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089651 Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Auto-Submit: Krzysztof Kotowicz <koto@google.com> Cr-Commit-Position: refs/heads/master@{#747250} -- wpt-commits: d8dea9c9ca97bab3138d89db56e707046533680f wpt-pr: 22101
…PolicyNames()., a=testonly Automatic update from web-platform-tests [Trusted Types] Removed trustedTypes.getPolicyNames(). Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089651 Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Auto-Submit: Krzysztof Kotowicz <koto@google.com> Cr-Commit-Position: refs/heads/master@{#747250} -- wpt-commits: d8dea9c9ca97bab3138d89db56e707046533680f wpt-pr: 22101
…PolicyNames()., a=testonly Automatic update from web-platform-tests [Trusted Types] Removed trustedTypes.getPolicyNames(). Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089651 Reviewed-by: Daniel Vogelheim <vogelheimchromium.org> Commit-Queue: Daniel Vogelheim <vogelheimchromium.org> Auto-Submit: Krzysztof Kotowicz <kotogoogle.com> Cr-Commit-Position: refs/heads/master{#747250} -- wpt-commits: d8dea9c9ca97bab3138d89db56e707046533680f wpt-pr: 22101 UltraBlame original commit: 0f42be9545337471a2ae6e07f598c0ac7f9e8176
…PolicyNames()., a=testonly Automatic update from web-platform-tests [Trusted Types] Removed trustedTypes.getPolicyNames(). Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089651 Reviewed-by: Daniel Vogelheim <vogelheimchromium.org> Commit-Queue: Daniel Vogelheim <vogelheimchromium.org> Auto-Submit: Krzysztof Kotowicz <kotogoogle.com> Cr-Commit-Position: refs/heads/master{#747250} -- wpt-commits: d8dea9c9ca97bab3138d89db56e707046533680f wpt-pr: 22101 UltraBlame original commit: 0f42be9545337471a2ae6e07f598c0ac7f9e8176
…PolicyNames()., a=testonly Automatic update from web-platform-tests [Trusted Types] Removed trustedTypes.getPolicyNames(). Context: w3c/trusted-types#235 Bug: 739170 Change-Id: I8499534f4351ea2c9f689071f3d6510238382d72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089651 Reviewed-by: Daniel Vogelheim <vogelheimchromium.org> Commit-Queue: Daniel Vogelheim <vogelheimchromium.org> Auto-Submit: Krzysztof Kotowicz <kotogoogle.com> Cr-Commit-Position: refs/heads/master{#747250} -- wpt-commits: d8dea9c9ca97bab3138d89db56e707046533680f wpt-pr: 22101 UltraBlame original commit: 0f42be9545337471a2ae6e07f598c0ac7f9e8176
Pulling up a side-note as a separate comment:
With
'allow-duplicates'
in place, I'd be a bit worried thatbecomes a common idiom to create policy without getting a security review.
It might be worth getting rid of
getPolicyNames
; it doesn't seem all that valuable. For detailed monitoring/telemetry a callback or event that can also see stack traces would be more appropriate.Originally posted by @xtofian in #222 (comment)
The text was updated successfully, but these errors were encountered: