Skip to content
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

Why do base-uri and frame-ancestors have different grammars? #431

Open
bakkot opened this issue Apr 23, 2020 · 2 comments
Open

Why do base-uri and frame-ancestors have different grammars? #431

bakkot opened this issue Apr 23, 2020 · 2 comments

Comments

@bakkot
Copy link

bakkot commented Apr 23, 2020

The value for base-uri is a serialized-source-list, which means that, for example, base-uri 'unsafe-eval' is legal.

By contrast, the value frame-ancestors is an ancestor-source-list, which is exactly like serialized-source-list except that it only takes hosts, schemes, or 'self', or 'none'.

In both cases the only operation performed is Does url match source list in origin with redirect count?, which is only concerned with hosts, schemes, and 'self'. In neither case is there a fallback to any other directive. So why do they have different grammars?

(navigate-to similarly only cares about URLs except that it also allows 'unsafe-allow-redirects', which is technically a keyword-source, but is used only by navigate-to.)

@annevk
Copy link
Member

annevk commented Apr 23, 2020

Are there detailed tests for this? What browsers do probably influences to what extent this can be cleaned up.

@bakkot
Copy link
Author

bakkot commented Apr 23, 2020

There do not appear to be any tests for base-uri directives which contain anything other than a single fully qualified URL.

(In general the behavior for unusual CSPs is very poorly specified and even more poorly tested.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants