linkedin / linkedin/dustjs

Infinite recursion in param resolve

Open
#486 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.9k
Forks
461
PR merge metrics
No merged PRs in 30d

Description

Hi there,

you are most likely aware of this, but I'm filing this as an issue anyway. As you point out in the wiki (https://github.com/linkedin/dustjs/wiki/Dust-Tutorial#Parameter_rules) params will overlay the context with their own "namespace" for resolving themselves if their values are template strings.

This can lead to infinite recursion if a param value string references a context element with the same name as the param key.

Less words, more code: https://gist.github.com/darkspotinthecorner/6564b77cc2e4165a935a

I know, it's a bit contrieve, but maybe it's worth fixing. ;)

PS: Great work here, I really enjoy working with dustjs!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reproduction linked in the issue and the wiki's Parameter rules section, then locate the parameter-resolution entry point in Dust. Trace the self-referential template-string case and add a regression test showing that it terminates without infinite recursion while preserving normal parameter and context resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.