-
Notifications
You must be signed in to change notification settings - Fork 28
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
Adhere better to secure extension guidelines #72
Comments
I could insert a script at the my local extension. If you want to see how I've done that, I can send you more details or we can schedule a small meeting. If you wonder, why I'm so interested at the extension, it is because I've created a similar one, CSS Beautifier, and I'm having the same kind of concerns you may have |
I think the main thing we’re trying to do with this if is detect whether we already rendered the markdown. Basically the script runs on a text file, and might be triggered more than once, in which case we shouldn’t run the renderer again. |
The initial file were supposed to be a plain text, but there is a way to deceive the extension at this version. |
I see, we perform markdown rendering on html pages that masquerade as text files displayed by firefox (i.e. html pages with a single In both cases (script in the header or within the Your suggestion is that we shouldn’t render pages that have javascript running on them because that risks fingerprinting, right? I think we could follow (some of) the recommendations from the MDN page to which you link, but I would rather see fixes that follow these guidelines:
|
Indeed, following some of the official recommendations would solve the problem altogether. Alternatively, one could take some features back (like the highlight themes, that is not anyway working right now). I'm not sure if the extension shouldn't render pages that aren't real plain texts. I've decided for now for my extension, the CSS Beautifier, not to do that, but maybe the user wants to have it beautified, even knowing that it is not a pure md file. My security patch #73 is just a momentary solution. It is a quicker than implementing one of the MDN recommendations, and it does not lead to deleting an existing feature. But a more robust solution is needed, you are right on that. |
Here’s how we stand on the security guidelines currently:
|
Also switch to https://github.com/highlightjs/cdn-release for hljs releases, rather than the shim repo that is not updated regularly. Also add a script that can automatically get the latest release of our dependencies: git submodule foreach ../last_release.sh
Closing this as v2 (#99) will have proper security, including rendering in an extension page instead of on an already opened page, and placing the rendered result in a sandboxed iframe. |
Hi,
I've noticed a security issue. The conditions to process the data are not enough to prevent a malicious site to insert an script at the head or at the < pre >.
I've already fixed that and you are going to receive the pull request soon.
The text was updated successfully, but these errors were encountered: