Skip to content

fix(config): Implement strict envvar handling to prevent insecure text replacement - #17966

Merged
mstrandboge merged 2 commits into
influxdata:masterfrom
srebhan:config_internal_543_non_breaking
Nov 15, 2025
Merged

mstrandboge merged 2 commits into
influxdata:masterfrom
srebhan:config_internal_543_non_breaking

Conversation

@srebhan

@srebhan srebhan commented Nov 10, 2025 •

Copy link
Copy Markdown
Member

Summary

Implement a strict version of handling environment variables which uses the capabilities of TOML parsing instead of replacing the environment variables in the raw text. This comes at a cost of only being able to use environment variables
in string settings because the initial config file must be TOML conform.

Note

The strict handling requires to opt-in using the --strict-env-handling command-line option

Checklist

Related issues

@telegraf-tiger telegraf-tiger Bot added the fix pr to fix corresponding bug label Nov 10, 2025

@skartikey skartikey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srebhan Well designed and tested. Just one minor comment.

Comment thread config/testdata/envvar_malicious.conf Outdated
@srebhan
srebhan requested a review from skartikey November 13, 2025 11:51
@telegraf-tiger

Copy link
Copy Markdown
Contributor

@skartikey skartikey removed their assignment Nov 13, 2025
@skartikey skartikey added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 13, 2025
mstrandboge
mstrandboge approved these changes Nov 15, 2025