Commit Graph

586 Commits

Author SHA1 Message Date
Andrey Petrov 635673882b
Update BUG.yml 2024-09-06 14:10:40 -04:00
Andrey Petrov e16725f08e
Update BUG.yml 2024-09-06 14:09:21 -04:00
Andrey Petrov 89b7218461
Update and rename bug_report.md to BUG.yml 2024-09-06 14:09:03 -04:00
Andrey Petrov daf4677fe3
Merge pull request #427 from bsiegert/crypto
Bump golang.org/x/crypto to 0.17.0 (security)
2023-12-22 13:27:17 -05:00
Benny Siegert bdd716e621 Bump golang.org/x/crypto to 0.17.0 (security)
This fixes the following vulnerabilities, as reported by govulncheck:

Vulnerability #1: GO-2023-2402
    Man-in-the-middle attacker can compromise integrity of secure channel in
    golang.org/x/crypto
  More info: https://pkg.go.dev/vuln/GO-2023-2402
  Module: golang.org/x/crypto
    Found in: golang.org/x/crypto@v0.0.0-20200420104511-884d27f42877
    Fixed in: golang.org/x/crypto@v0.17.0
    Example traces found:
      #1: work/ssh-chat-1.10/sshd/client.go:42:33: sshd.ConnectShell calls ssh.Client.NewSession
      #2: work/ssh-chat-1.10/sshd/client.go:36:23: sshd.ConnectShell calls ssh.Dial
      #3: work/ssh-chat-1.10/sshd/net.go:49:2: sshd.SSHListener.handleConn calls ssh.DiscardRequests
      #4: work/ssh-chat-1.10/sshd/net.go:43:55: sshd.SSHListener.handleConn calls ssh.NewServerConn
      #5: work/ssh-chat-1.10/sshd/terminal.go:222:13: sshd.Terminal.listen calls ssh.Request.Reply
      #6: work/ssh-chat-1.10/sshd/client.go:46:2: sshd.ConnectShell calls ssh.Session.Close
      #7: work/ssh-chat-1.10/sshd/client.go:70:30: sshd.ConnectShell calls ssh.Session.SendRequest
      #8: work/ssh-chat-1.10/sshd/client.go:65:21: sshd.ConnectShell calls ssh.Session.Shell
      #9: work/ssh-chat-1.10/cmd/ssh-chat/cmd.go:243:14: ssh.main calls fmt.Fprintln, which eventually calls ssh.channel.Read
      #10: work/ssh-chat-1.10/sshd/terminal/terminal.go:954:17: terminal.Terminal.SetBracketedPasteMode calls io.WriteString, which calls ssh.channel.Write
      #11: work/ssh-chat-1.10/cmd/ssh-chat/cmd.go:243:14: ssh.main calls fmt.Fprintln, which eventually calls ssh.extChannel.Read

Vulnerability #4: GO-2022-0968
    Panic on malformed packets in golang.org/x/crypto/ssh
  More info: https://pkg.go.dev/vuln/GO-2022-0968
  Module: golang.org/x/crypto
    Found in: golang.org/x/crypto@v0.0.0-20200420104511-884d27f42877
    Fixed in: golang.org/x/crypto@v0.0.0-20211202192323-5770296d904e
    Example traces found:
      #1: work/ssh-chat-1.10/sshd/client.go:36:23: sshd.ConnectShell calls ssh.Dial
      #2: work/ssh-chat-1.10/sshd/net.go:43:55: sshd.SSHListener.handleConn calls ssh.NewServerConn

Vulnerability #5: GO-2021-0356
    Denial of service via crafted Signer in golang.org/x/crypto/ssh
  More info: https://pkg.go.dev/vuln/GO-2021-0356
  Module: golang.org/x/crypto
    Found in: golang.org/x/crypto@v0.0.0-20200420104511-884d27f42877
    Fixed in: golang.org/x/crypto@v0.0.0-20220314234659-1baeb1ce4c0b
    Example traces found:
      #1: work/ssh-chat-1.10/cmd/ssh-chat/cmd.go:122:19: ssh.main calls ssh.ServerConfig.AddHostKey

Vulnerability #6: GO-2021-0227
    Panic on crafted authentication request message in golang.org/x/crypto/ssh
  More info: https://pkg.go.dev/vuln/GO-2021-0227
  Module: golang.org/x/crypto
    Found in: golang.org/x/crypto@v0.0.0-20200420104511-884d27f42877
    Fixed in: golang.org/x/crypto@v0.0.0-20201216223049-8b5274cf687f
    Example traces found:
      #1: work/ssh-chat-1.10/sshd/net.go:43:55: sshd.SSHListener.handleConn calls ssh.NewServerConn
2023-12-22 18:25:25 +01:00
Andrey Petrov 1fc7f7b10b
Merge pull request #421 from DejavuMoe/build/linux-arm64
add: build releases for linux/arm64
2023-02-02 12:16:01 -05:00
DejavuMoe c884aee673
add: build releases for linux/arm64 2023-02-02 15:23:02 +08:00
Andrey Petrov aaf0671f01 go mod update
Fixes #419 #409
2022-11-27 20:15:03 -06:00
Andrey Petrov 748fc819e7
Merge pull request #416 from sleibrock/master
Fixing emojis being sent in PMs when no theme is set (#414)
2022-07-31 10:08:56 -04:00
Andrey Petrov 4b4270f0ca
Merge pull request #417 from sleibrock/motd-bot-fix
host.go: avoiding motd output if bot mode set
2022-07-30 15:05:16 -04:00
Steven Leibrock ae585079e7 host.go: avoiding motd output if bot mode set 2022-07-29 21:57:49 -04:00
Steven L 1102162d1f message.go: stripping emoji for when no theme is set 2022-07-28 12:29:53 -04:00
Andrey Petrov 68e9d6880d
Merge pull request #410 from pataquets/master
Docker Compose manifest: mount host's keys and few other improvements.
2022-03-07 14:44:07 -05:00
pataquets 3f857cf1f5 Docker Compose manifest: mount host's keys and few other improvements.
* Add SSH keys mount (mimicking default non-Docker behaviour).
* Increase manifest version to lowest 3.x supporting bind mounts.
* Change restart policy from `always` to `unless-stopped`.
* Set a container name.
* Fix port indentation to 2 spaces, as done elsewhere.
2022-03-07 20:22:01 +01:00
Andrey Petrov df72223a5f go mod update 2022-01-29 15:05:59 -05:00
mik2k2 621ae1b0d3
Add /allowlist command (#399)
* move loading whitelist+ops from file to auth and save the loaded files fro reloading

* add /whitelist command with lots of open questions

* add test for /whitelist

* gofmt

* use the same auth (the tests don't seem to care, but htis is more right)

* mutex whitelistMode and remove some deferred TODOs

* s/whitelist/allowlist/ (user-facing); move helper functions outside the handler function

* check for ops in Auth.CheckPublicKey and move /allowlist handling to helper functions

* possibly fix the test timeout in HostNameCollision

* Revert "possibly fix the test timeout in HostNameCollision" (didn't work)

This reverts commit 664dbb0976.

* managed to reproduce the timeout after updating, hopefully it's the same one

* remove some unimportant TODOs; add a message when reverify kicks people; add a reverify test

* add client connection with key; add test for /allowlist import AGE

* hopefully make test less racy

* s/whitelist/allowlist/

* fix crash on specifying exactly one more -v flag than the max level

* use a key loader function to move file reading out of auth

* add loader to allowlist test

* minor message changes

* add --whitelist with a warning; update tests for messages

* apparently, we have another prefix

* check names directly on the User objects in TestHostNameCollision

* not allowlisted -> not allowed

* small message change

* update test
2022-01-06 09:09:51 -05:00
Andrey Petrov 84bc5c76dd go mod update for golang.org/x/crypto/ssh 2021-12-03 11:03:08 -05:00
Andrey Petrov 82526e9123
Update ssh.chat pubkey 2021-10-13 11:30:58 -04:00
Akshay Shekher d25630020d
/back, /away: Change no-op to return err
Fixes #402

When the user is not set as away, using the
`/back` or `/away` command should return error.
The previous behaviour was inconsistent,
`/away` sent a message and `/back` ignored it.
New behaviour is error for both cases.

Co-authored-by: Akshay <akshay.shekher@gmail.com>
2021-10-13 11:00:11 -04:00
Andrey Petrov 0eebb64c1d sshd/terminal/terminal.go: Clamp pos to protect from some fuzzing failures 2021-10-13 10:43:49 -04:00
Andrey Petrov db14517499 cmd/ssh-chat: Accept multiple --identity keys
Fixes #401
2021-10-13 10:27:04 -04:00
Andrey Petrov 88fa53fd16 Makefile: deploy tweak 2021-10-11 10:18:06 -04:00
mik2k2 7628a47c4c
set: Allow nil/expired items
Fixes #397
2021-07-03 13:37:09 -04:00
mik2k2 7413539965
main, sshd: Refactor authentication, add IP throttling, improve passphrase auth
* Move password authentication handling into sshd/auth (fixes #394).

Password authentication is now completely handeled in Auth. The normal
keyboard-interactive handler checks if passwords are supported and asks
for them, removing the need to override the callbacks.

Brute force throttling is removed; I'd like to base it on IP address
banning, which requires changes to the checks.

I'm not sure, but I think timing attacks against the password are fixed:
- The hashing of the real password happens only at startup.
- The hashing of a provided password is something an attacker can do
themselves; It doesn't leak anything about the real password.
- The hash comparison is constant-time.

* refactor checks, IP-ban incorrect passphrases, renames

- s/assword/assphrase/, typo fixes
- bans are checked separately from public keys
- an incorrect passphrase results in a one-minute IP ban
- whitelists no longer override bans (i.e. you can get banned if you're 
whitelisted)

* (hopefully) final changes
2021-05-31 10:08:30 -04:00
Akshay Shekher c3b589b286
tests: Fixed flaky test by using user joined callback. (#393)
Instead of relying on the go scheduler to do the expected thing >_>

Co-authored-by: Akshay <akshay.shekher@gmail.com>
2021-05-02 13:02:39 -04:00
Akshay Shekher e1e534344e
Fix SSHCHAT_TIMESTAMP env variables (#392)
* Fixes Env Vars to pass config to ssh-chat.

The env vars were beign parsed and set to the host
before the user was even added to the host and
hence ignored. This change moves the env var parsing
to after initializing the user.

TODO: tests, completeness+reliability

* cleaned up the test

* reduced test flakyness by adding wait instead of being optimistic

Co-authored-by: Akshay <akshay.shekher@gmail.com>
2021-05-02 12:18:31 -04:00
Andrey Petrov 46eaf037e3
Merge pull request #390 from shazow/shazow-patch-3
tests: Skip flakey TestHostNameCollision
2021-04-24 12:49:09 -04:00
Andrey Petrov 3c246777a1
tests: Skip flakey TestHostNameCollision 2021-04-24 12:22:42 -04:00
Andrey Petrov fef128b91f
Merge pull request #389 from shazow/shazow-patch-2
ci: Test all sub-packages
2021-04-24 12:18:44 -04:00
Andrey Petrov 1ef05d0c26
ci: Test all sub-packages 2021-04-24 12:16:10 -04:00
Andrey Petrov af502977e6
Merge pull request #388 from voldyman/ill-be-back
Added /back and tests for all away commands
2021-04-24 12:15:22 -04:00
Andrey Petrov c3dccfd3eb
chat: /back help formatting. 2021-04-24 12:14:24 -04:00
Akshay aae5bc8d2e Added /back and tests for all away commands 2021-04-24 07:54:50 -07:00
Andrey Petrov fb73ace458
Merge pull request #385 from sytranvn/build-apple-silocon
Add build script for apple silicon
2021-04-19 09:45:02 -04:00
Sy Tran 3557bf762d Add build script for apple silicon 2021-04-18 07:31:13 +07:00
Andrey Petrov fa3146c800 Makefile: Add deploy helper 2021-04-13 11:32:24 -04:00
Andrey Petrov badcaa6e3b /away: Fix output for admin whois
cc #377
2021-04-13 11:27:44 -04:00
Andrey Petrov 9bf66ea992
Merge pull request #383 from shazow/add-mute
chat: Add /mute command for op
2021-04-13 11:24:53 -04:00
Andrey Petrov 37b101c3c1 chat: Add /mute command for op 2021-04-13 11:21:16 -04:00
Andrey Petrov b73b45640c host: Fix /msg vs /reply message formatting
Closes #382
2021-04-06 09:28:48 -04:00
Andrey Petrov 7a783d46af sshd, chat/message: Add more debug logging for close failures 2021-04-05 11:06:44 -04:00
Andrey Petrov 3848014d41 main: Update host_test.go to pass vet, use errgroup 2021-03-26 12:49:08 -04:00
Andrey Petrov 3f81d84cf1 cmd/ssh-chat: Use x/term instead of howeyc/gopass, update prompt
Fixes #380
2021-03-26 12:26:18 -04:00
Andrey Petrov 4840634434 go mod update 2021-03-26 12:17:55 -04:00
Andrey Petrov 8257ada10d host: Factor out PM code, add away status 2021-03-15 11:07:52 -04:00
Andrey Petrov 9329227403 chat: /away tweaks 2021-03-15 10:53:00 -04:00
Akshay 0338cb824d chat: Added support for user away status, fixes #377
made away toggle status, like irc

updated /away feature

* added away message
* added broadcast away message as emote
* updated names list to show away users on the same line, with colors

added /away -> back message

Update away time to be time since marked away

reverted changes made for /list
2021-03-15 10:30:54 -04:00
Andrey Petrov c8bfc34704
Merge pull request #376 from medinae/reply-to-user-with-symbol-fix
Fix ~ Reply to user with symbol returning Err user not found
2021-03-13 10:08:49 -05:00
Abdelkader Bouadjadja ebbbc3b6d9 Fix ~ Reply to user with symbol returning Err user not found 2021-03-13 14:56:36 +04:00
Andrey Petrov d8183dd305
Update bug_report.md 2021-02-06 09:33:28 -05:00