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

duplicated CSP frame-ancestors policy #10042

Open
wkloucek opened this issue Sep 12, 2024 · 2 comments
Open

duplicated CSP frame-ancestors policy #10042

wkloucek opened this issue Sep 12, 2024 · 2 comments
Labels

Comments

@wkloucek
Copy link
Contributor

Describe the bug

On the root path of oCIS, we get two content-security-policy headers. One has a static frame-ancestors 'self' config

Steps to reproduce

  1. run oCIS 6.3.0 eg. in Kubernetes using the development-install deployment example
  2. open oCIS, eg https://ocis.kube.owncloud.test/ after opening the network console
  3. Look at the request to https://ocis.kube.owncloud.test/

Expected behavior

Have one header content-security-policy reflecting my oCIS csp configuration.

Actual behavior

image

Further context

The second header seems to be statically set to frame-ancestors 'self' and always there, even if I have a more sophisticated CSP config

@wkloucek
Copy link
Contributor Author

This additional header probably originates here:

// SilentRefresh allows the oidc client lib to silently refresh the token in an iframe
func SilentRefresh(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Security-Policy", "frame-ancestors 'self'")
next.ServeHTTP(w, r)
})
}

@wkloucek
Copy link
Contributor Author

And what it actually does: it takes precedence over the frame-ancestors policy in the first header...

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

No branches or pull requests

1 participant