-
Notifications
You must be signed in to change notification settings - Fork 31
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
validation of per-element / per-attribute contents #26
Comments
I could imagine an event-based validation approach similar to DOMPurify's event hooks, but I'd like to delay this discussion, until we're done with prototyping. |
I agree we'll need something better than allow/block, eventually. I'd prefer to leave this to a v2. Declarative vs callback: IMHO, a declarative value spec - as in this proposal - has very nice security properties, but also tends to be a bottom-less pit in terms of complexity because there's always another new use-case that isn't quite covered by the existing facility. Callbacks are more flexible and more web-by, but IMHO more difficult to reason about. No idea what's best. |
A common usecase for URL validation in sanitizer is to either define a set
of domains you allow the URL to point to, and to rewrite the URLs to proxy
the request through a 1st party server for privacy concerns (e.g.. not
disclosing the IP of the user).
…On Mon, Jul 6, 2020 at 4:01 PM Daniel ***@***.***> wrote:
I agree we'll need something better than allow/block, eventually. I'd
prefer to leave this to a v2.
Declarative vs callback: IMHO, a declarative value spec - as in this
proposal - has very nice security properties, but also tends to be a
bottom-less pit in terms of complexity because there's always another new
use-case that isn't quite covered by the existing facility. Callbacks are
more flexible and more web-by, but IMHO more difficult to reason about. No
idea what's best.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA7JK7GHJ6Y3ZTESSPC5BLR2HKJ5ANCNFSM4ORRYZHA>
.
--
koto@ / Krzysztof Kotowicz / Google
|
The above does not strike me as a task for a sanitizer. |
Well, it is something folks are already doing with CSP, so I'd rather move this to "later". |
@cure53, I assume you're talking about URL validation? If you're talking about the list of allowed tags, their attributes, and their values... what's considered safe/allowed varies; e.g. I cannot allow any inline styles (52pt red text would go against brand guidelines), but I might allow some known-safe class values (my light grey text being incorrectly used on a white background would cause accessibility issues), and in some locations I might allow |
We were referring to @koto 's use case.
This one. |
My 2 cents: We should keep the v1 focused on XSS. I'd really like the sanitizer to be easy to use for not-security-trained web devs. v2: I think it makes a lot of sense to look at sanitizer-adjacent use-cases for a v2, where an application might have app-specific constraints (like conditions on outgoing urls, or styles, or whatnot). If we can provide additional dev value without impairing the main use case we should probably do so, just not in the first step |
Fully agree here. I'm assigning the v2 milestone, which means it's explicitly marked as interesting, but for later. |
Related spec for declarative URL validation, which could apply here: whatwg/urlpattern#26 (Still v2 milestone, just wanted to surface this here so it doesn't get lost.) |
@craigfrancis wrote in #18.
The text was updated successfully, but these errors were encountered: