Questions about security, CSP, localstorage #110
-
I have implemented Now my question is the following: I tried to switch to I also looked into implementing CSP tags. I see that flutter requires quite a few liberties, which greatly diminishes the XSS protection you can gain from CSP. Maybe I can use nonce or potentially generate hashes for every build. Otherwise the tokens could be exposed to malicious actors. Anyway, I'm dumping a lot of info here. Bottom line, what is your recommendation? Stick with _blank and nuke the UX or work harder to get _self more secure by deleting the tokens and implementing CSP via nonce and hash? Edit: What about rendering an iframe in a modal on top of the flutter app. That would keep the iframe message mechanism intact. Also the UX would look seamless. Edit2: Clickjacking - via https://datatracker.ietf.org/doc/html/rfc6749#section-10.13 In a clickjacking attack, an attacker registers a legitimate client To prevent this form of attack, native applications SHOULD use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The local storage approach is chosen when the other approaches would fail - it acts as a workaround, basically.
In a nutshell: Not inherently - it depends on the use case, though. If your website is susceptible to XSS, yes, it is unsafe.
They should be removed after successful authentication as far as I am concerned:
Mostly, I like going the KISS way - hence I would just diregard the UX. Maybe, I or someone else finds another way to fallback on when authenticating users on Web. Then, anyone using this package can benefit from smoother authentication procedures without needing to live with some compromise or needing to implement "unnecessary" (wrong word, but I think you get the gist) workarounds.
Also possible! Now that I think of it - I could even enable another parameter in |
Beta Was this translation helpful? Give feedback.
The local storage approach is chosen when the other approaches would fail - it acts as a workaround, basically.
In many modern browser,
window.opener
is set tonull
when opening new tabs in specific ways to prevent tabnabbing attacks.And the same way
window.parent
might be reset tonull
.If both are set to
null
(or for some reasonwindow.parent
is invalid), authentication is usingpostMessage
is not possible anymore.f…