How to prevent denial of service caused by endless loop?
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
I have noticed that there is no upper limits on iterations which makes it easy for someone to brick an app by launching an infinite loop:
Liquid::Template.parse("{% for n in (1..100000) %}{% endfor %}").render
Is there a configuration to prevent this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported Liquid::Template.parse(...).render example and inspect the rendering and configuration entry points that govern loop execution. Done should include a defined way to prevent unbounded iteration and a clear behavior for templates exceeding the limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- performance, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100