-
Notifications
You must be signed in to change notification settings - Fork 40
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
Limit nested tags to 100 by default #50
Comments
@edgurgel do you have any idea on this? When using render tag, it's hard to track nested tag. And we cannot use Context to carry nested tag level because some tag render does not pass context to inner scope. Another thought is put nested level value in current process, but I think it's kind of hack |
🤔 def eval(tag, context, options) do
current_stack_level = context.stack_level
context = %{context | stack_level: current_stack_level + 1}
{result, new_context} = case do_eval(tag, context, options) do
{text, context} ->
{text, context}
text when is_binary(text) ->
{[text: text], context}
text ->
{text, context}
end
new_context = %{new_context | stack_level: current_stack_level}
{result, new_context}
end And we just trust that tags are passing Context around? If people add custom tags that don't pass the Context around then there is not much we can do to protect them? And we change the What do you think? The process solution could work if we maybe used the Process dictionary or something else like an ets table? But it feels hacky as you said 🤔 |
Can't the |
@Jcambass yeah definitely worth documenting that! |
We want to limit how deep a liquid template can get to just like the Liquid gem does: https://github.com/Shopify/liquid/blob/efef03d944157db323f1aed5e19861bf66fe256f/test/integration/security_test.rb#L82-L88
The text was updated successfully, but these errors were encountered: