You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support variable expansion in DotEnv features #65705
The APPLICATION_PORT and BASE_URL should have the same port. For reasons external to this issue, BASE_URL cannot be split into two variables without causing confusion.
If there are external overrides to APPLICATION_PORT, they won't remain in sync with BASE_URL.
What is the feature you are proposing to solve the problem?
This is already supported by at least bash, and the concept of variable expansion in environmental configuration is also common in ecosystems such as Kubernetes.
What alternatives have you considered?
Using dotenvx
Splitting variables up into their lowest common set
I’d like to investigate adding variable expansion support to Node.js DotEnv handling, including references such as ${APPLICATION_PORT} inside another variable's value.
I can look into the existing DotEnv parser and determine how expansion should interact with variable ordering, environment overrides, undefined references, and recursive/circular references while keeping the current behavior backward compatible.
I’ll also add appropriate tests covering the supported expansion syntax and relevant edge cases.
If this issue is available, please assign it to me. Thanks!
cc @nodejs/security-wg Wouldn't this have security implications, e.g. if you set one variable to a user-controlled value, they can affectively access and modify any system variable?
Activity
Shivang9983 commentedon Sep 5, 2026
Hi, @daeyeon I’d like to work on this issue.
I’d like to investigate adding variable expansion support to Node.js DotEnv handling, including references such as
${APPLICATION_PORT}inside another variable's value.I can look into the existing DotEnv parser and determine how expansion should interact with variable ordering, environment overrides, undefined references, and recursive/circular references while keeping the current behavior backward compatible.
I’ll also add appropriate tests covering the supported expansion syntax and relevant edge cases.
If this issue is available, please assign it to me. Thanks!
avivkeller commentedon Sep 23, 2026
cc @nodejs/security-wg Wouldn't this have security implications, e.g. if you set one variable to a user-controlled value, they can affectively access and modify any system variable?
For example,
Allowing bash expansion allows for the modification of variables outside the dotenv file, no?