-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v16] prevent session id reuse (#42133)
* prevent SSH session id reuse If a user sets `TELEPORT_SESSION` to a session ID that isn't running, the sent session ID is ignored and a new one is used to prevent the user controlling the value. When parsing a session ID the parsed result is used to ensure all session IDs will have the same format. `CreateSessionTracker` is updated to create instead of upsert to ensure `SessionTracker` resources cannot be overwritten by accident. Clients often need to know the current session ID, and before when they were in control of it that wasn't an issue. To fix this servers will send the current session ID in a SSH channel request on the channel the SSH session was created on. This should be fully backwards compatible, as when an unknown SSH request type is received clients will just ignore it/reply with false. * add test for wrappedSSHConn
- Loading branch information
1 parent
836b145
commit 646bd5f
Showing
21 changed files
with
449 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -731,6 +731,14 @@ const ( | |
// version they are running. | ||
VersionRequest = "x-teleport-version" | ||
|
||
// CurrentSessionIDRequest is sent by servers to inform clients of | ||
// the session ID that is being used. | ||
CurrentSessionIDRequest = "[email protected]" | ||
|
||
// SessionIDQueryRequest is sent by clients to ask servers if they | ||
// will generate their own session ID when a new session is created. | ||
SessionIDQueryRequest = "[email protected]" | ||
|
||
// ForceTerminateRequest is an SSH request to forcefully terminate a session. | ||
ForceTerminateRequest = "x-teleport-force-terminate" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.