Skip to content

[v14] Careful handling when loading files#31958

Merged
jentfoo merged 16 commits intobranch/v14from
bot/backport-31721-branch/v14
Sep 15, 2023
Merged

[v14] Careful handling when loading files#31958
jentfoo merged 16 commits intobranch/v14from
bot/backport-31721-branch/v14

Conversation

@jentfoo
Copy link
Copy Markdown
Contributor

@jentfoo jentfoo commented Sep 15, 2023

Backport #31721 to branch/v14

jentfoo and others added 16 commits September 15, 2023 15:19
This commit attempts to provide a common API so that the decision of when to follow symlinks is a conscious decision.
Because Teleport (particularly the agent) runs in a privilege context, there is risk that following symlinks may allow information disclosure.

After review of the cases covered in this commit (and some additional cases where this API was not a natural fit), this does not appear to be a broad problem.  This commit however does fix the one known flaw described in the issue https://github.com/gravitational/teleport-private/issues/1009
Co-authored-by: Krzysztof Skrzętnicki <krzysztof.skrzetnicki@goteleport.com>
After PR discussion it was highlighted that MacOS does not guard against hardlinks in the same way linux does.  For that reason this implementation has been updated with OS conditional logic to validate against hardlinks.
Make hardlink count lookup code build conditional to avoid undefined syscall.Stat_t.
@jentfoo jentfoo self-assigned this Sep 15, 2023
@github-actions github-actions Bot added backport machine-id size/md tctl tctl - Teleport admin tool labels Sep 15, 2023
@jentfoo
Copy link
Copy Markdown
Contributor Author

jentfoo commented Sep 15, 2023

I thought these commits would be squashed, in the future I will cleanup the history first

@jentfoo jentfoo added this pull request to the merge queue Sep 15, 2023
Merged via the queue into branch/v14 with commit 9e166c0 Sep 15, 2023
@jentfoo jentfoo deleted the bot/backport-31721-branch/v14 branch September 15, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants