-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Feature request: add a flag to disable converter template helpers loading to prevent arbitrary code execution #1727
Comments
Hey! I thought Hugo was using Asciidoctor (Ruby) CLI?
Do we need to a CLI flag? |
I don't think that's true. require 'fileutils'
FileUtils.rm_rf("/") Then, it will perform this action. |
Hello, Thanks for your reply.
Hugo calls
Sadly, we missed that point. |
With
...the file is not deleted (that's a good thing). How can I delete the file from a handlebars converter template? If there's a vulnerability in our use case, I want to prove it. |
Add a |
Before adding the |
@ggrossetie If we reject a |
I'm not a security expect but I guess that would prevent Asciidoctor from loading the |
In Hugo's configuration file, the user would provide an array of converter template directory paths. Before passing those paths as |
Hi,
When using Hugo with Asciidoctor, we’re trying to see if we could allow Hugo theme authors to define converter templates to customize the HTML generated by Asciidoctor: gohugoio/hugo#12314. In this context, we cannot take the risk of theme authors being able to execute arbitrary code on the user environment.
We think that with the Ruby implementation of Asciidoctor, tilt and Handlebars, it’s OK (we don’t see ways of executing arbitrary code for the moment), though we’d like to be sure of it. But, it’s clearly not OK with Asciidoctor.js and Handlebars, because of helpers: https://docs.asciidoctor.org/asciidoctor.js/latest/extend/converter/template-converter/#helpers-js-file.
I didn’t find a way to disallow these helpers and only allow templates and partials. Do you think it could be possible to add a flag to disable helpers loading?
The text was updated successfully, but these errors were encountered: