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

fix(config): Implement strict envvar handling to prevent insecure text replacement#17966
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

@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 merged commit 7341bbf into influxdata:master Nov 15, 2025
26 of 27 checks passed
@github-actions github-actions Bot added this to the v1.36.4 milestone Nov 15, 2025
srebhan added a commit that referenced this pull request Nov 17, 2025
@daniel-falk

Copy link
Copy Markdown

Hi everyone! Is there any migration guide for this change? We are using environment variables both for numbers like metric_buffer_limit and for boolean flags, e.g. for the debug option in the agent configuration. What options are there to make this complaint without hard coding the option in the config file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/configuration fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

4 participants