Skip to content

Prevent loading default config in tctl on Windows#52184

Merged
rosstimothy merged 1 commit intomasterfrom
tross/tctl_data_dir
Feb 14, 2025
Merged

Prevent loading default config in tctl on Windows#52184
rosstimothy merged 1 commit intomasterfrom
tross/tctl_data_dir

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy commented Feb 14, 2025

On Windows tctl will attempt to load a teleport config file from the default path of C:\etc\teleport.yaml. However, on Windows, C:\etc\ does not exist by default, and may be created by any user.

This could potentially allow an unprivileged user to trick tctl into loading a malicious teleport.yaml file and perform some kind of MITM attack. In practice, this attack would have to be quite sophisticated since tctl does check the data directory defined in the config file and requires a host_uuid and a valid admin identity before proceeding with using the local credentials.

If this behavior is to be restored in the future, the default config path on Windows should be changed to something that respects Windows path conventions.

Changelog: Remove the ability of tctl to load the default configuration file on Windows.

On Windows tctl will attempt to load a teleport config file from
the default path of C:\etc\teleport.yaml. However, on Windows,
C:\etc\ does not exist by default, and may be created by any user.

This could potentially allow an unprivileged user to trick tctl
into loading a malicious teleport.yaml file and perform some kind
of MITM attack. In practice, this attack would have to be quite
sophisticated since tctl does check the data directory defined in
the config file and requires a host_uuid and a valid admin identity
before proceeding with using the local credentials.

If this behavior is to be restored in the future, the default
config path on Windows should be changed to something that respects
Windows path conventions.
@rosstimothy rosstimothy marked this pull request as ready for review February 14, 2025 16:02
@rosstimothy rosstimothy requested a review from zmb3 February 14, 2025 16:02
@github-actions github-actions Bot added size/sm tctl tctl - Teleport admin tool labels Feb 14, 2025
@github-actions github-actions Bot requested review from espadolini and tcsc February 14, 2025 16:03
@rosstimothy rosstimothy added this pull request to the merge queue Feb 14, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 14, 2025
@rosstimothy rosstimothy added this pull request to the merge queue Feb 14, 2025
Merged via the queue into master with commit 7624a36 Feb 14, 2025
@rosstimothy rosstimothy deleted the tross/tctl_data_dir branch February 14, 2025 17:26
@public-teleport-github-review-bot
Copy link
Copy Markdown

@rosstimothy See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Failed
branch/v17 Create PR

rosstimothy added a commit that referenced this pull request Feb 14, 2025
On Windows tctl will attempt to load a teleport config file from
the default path of C:\etc\teleport.yaml. However, on Windows,
C:\etc\ does not exist by default, and may be created by any user.

This could potentially allow an unprivileged user to trick tctl
into loading a malicious teleport.yaml file and perform some kind
of MITM attack. In practice, this attack would have to be quite
sophisticated since tctl does check the data directory defined in
the config file and requires a host_uuid and a valid admin identity
before proceeding with using the local credentials.

If this behavior is to be restored in the future, the default
config path on Windows should be changed to something that respects
Windows path conventions.
rosstimothy added a commit that referenced this pull request Feb 14, 2025
On Windows tctl will attempt to load a teleport config file from
the default path of C:\etc\teleport.yaml. However, on Windows,
C:\etc\ does not exist by default, and may be created by any user.

This could potentially allow an unprivileged user to trick tctl
into loading a malicious teleport.yaml file and perform some kind
of MITM attack. In practice, this attack would have to be quite
sophisticated since tctl does check the data directory defined in
the config file and requires a host_uuid and a valid admin identity
before proceeding with using the local credentials.

If this behavior is to be restored in the future, the default
config path on Windows should be changed to something that respects
Windows path conventions.
github-merge-queue Bot pushed a commit that referenced this pull request Feb 14, 2025
On Windows tctl will attempt to load a teleport config file from
the default path of C:\etc\teleport.yaml. However, on Windows,
C:\etc\ does not exist by default, and may be created by any user.

This could potentially allow an unprivileged user to trick tctl
into loading a malicious teleport.yaml file and perform some kind
of MITM attack. In practice, this attack would have to be quite
sophisticated since tctl does check the data directory defined in
the config file and requires a host_uuid and a valid admin identity
before proceeding with using the local credentials.

If this behavior is to be restored in the future, the default
config path on Windows should be changed to something that respects
Windows path conventions.
github-merge-queue Bot pushed a commit that referenced this pull request Feb 14, 2025
On Windows tctl will attempt to load a teleport config file from
the default path of C:\etc\teleport.yaml. However, on Windows,
C:\etc\ does not exist by default, and may be created by any user.

This could potentially allow an unprivileged user to trick tctl
into loading a malicious teleport.yaml file and perform some kind
of MITM attack. In practice, this attack would have to be quite
sophisticated since tctl does check the data directory defined in
the config file and requires a host_uuid and a valid admin identity
before proceeding with using the local credentials.

If this behavior is to be restored in the future, the default
config path on Windows should be changed to something that respects
Windows path conventions.
carloscastrojumo pushed a commit to carloscastrojumo/teleport that referenced this pull request Feb 19, 2025
On Windows tctl will attempt to load a teleport config file from
the default path of C:\etc\teleport.yaml. However, on Windows,
C:\etc\ does not exist by default, and may be created by any user.

This could potentially allow an unprivileged user to trick tctl
into loading a malicious teleport.yaml file and perform some kind
of MITM attack. In practice, this attack would have to be quite
sophisticated since tctl does check the data directory defined in
the config file and requires a host_uuid and a valid admin identity
before proceeding with using the local credentials.

If this behavior is to be restored in the future, the default
config path on Windows should be changed to something that respects
Windows path conventions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/branch/v17 size/sm tctl tctl - Teleport admin tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants