Skip to content

fix: sanitize tunnel name before using as config file path#21

Open
iamMrGaurav wants to merge 1 commit intofosrl:mainfrom
iamMrGaurav:fix/path-traversal-tunnel-config-filename
Open

fix: sanitize tunnel name before using as config file path#21
iamMrGaurav wants to merge 1 commit intofosrl:mainfrom
iamMrGaurav:fix/path-traversal-tunnel-config-filename

Conversation

@iamMrGaurav
Copy link

The tunnel name from user-supplied JSON config was used directly
in filepath.Join() when writing/removing tunnel config files,
allowing path traversal attacks (e.g. name: ../../system32/...).

Apply sanitizeServiceName() to the filename in both InstallTunnel
and UninstallTunnel, consistent with how the service name is
already sanitized.

Fixes a potential arbitrary file write/delete as SYSTEM.

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

How to test?

  The tunnel name from user-supplied JSON config was used directly
  in filepath.Join() when writing/removing tunnel config files,
  allowing path traversal attacks (e.g. name: ../../system32/...).

  Apply sanitizeServiceName() to the filename in both InstallTunnel
  and UninstallTunnel, consistent with how the service name is
  already sanitized.

  Fixes a potential arbitrary file write/delete as SYSTEM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant