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

Sandboxing navigator iFrames #84

Open
chocolatkey opened this issue Nov 7, 2024 · 2 comments
Open

Sandboxing navigator iFrames #84

chocolatkey opened this issue Nov 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@chocolatkey
Copy link
Member

The iframe elements used to show reflowable and FXL content can be sandboxed using various attributes described here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe. This can provide security enhancements and protect from malicious EPUBs, especially in a situation where content is user generated.

@chocolatkey chocolatkey added the enhancement New feature or request label Nov 7, 2024
@danielweck
Copy link
Member

FYI, possibly useful references:

@danielweck
Copy link
Member

the above links are sufficient, but many years ago I wrote a similar EPUB test book to check for window.top and window.parent security breaches in non-sandboxed iframes. I later ported it to the official EPUB test suite (in a branch):

https://github.com/IDPF/epub-testsuite/blob/feature%2FRS_integrity/content%2F30%2Fepub30-test-0160%2FEPUB%2Fxhtml%2Fsecurity-001.xhtml

window.parent.document.body.innerText = “HACKED!”;

window.top.document.getElementById("ID").innerHTML = “ Click here ”;

it's been a while since I last looked into this, but there was this breach method as well:

window.frameElement.ownerDocument.defaultView.location = “http://hack.me”;

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

No branches or pull requests

2 participants