AuthorizedPrincipalsCommand is ignored if AuthorizedKeysCommand is set
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
openssh (Ubuntu) | Status tracked in Mantic | |||||
Jammy |
Fix Released
|
Undecided
|
Michał Małoszewski | |||
Lunar |
Fix Released
|
Undecided
|
Michał Małoszewski | |||
Mantic |
Fix Released
|
Undecided
|
Michał Małoszewski |
Bug Description
[Impact]
User of openssh reported an issue that affects Lunar and Jammy.
If AuthorizedKeysC
[Test Plan]
Launch container:
$ lxc launch ubuntu:jammy <container-name>
Shell into that container:
$ lxc shell <container-name>
Create the main directory for our task (e.g. “reproducer”)
# mkdir reproducer
Go to that directory:
# cd reproducer
Create 2 more dirs that reflect users:
# mkdir certuser keyonlyuser
Go to the keyonlyuser:
# cd keyonlyuser
Do:
# ssh-keygen -t ed25519 -f key
Go to the certuser:
# cd /root/reproduce
Do:
# ssh-keygen -t rsa -f ca
# ssh-keygen -t ed25519 -f key
# ssh-keygen -s ca -I key_id -n certuser key.pub
Create a script '/root/
#!/bin/sh
if [ "$1" = "otheruser" ]; then
echo certuser
fi
Exit the file.
Ensure you are in the /root/reproducer/ directory:
# adduser --disabled-password otheruser
(Enter multiple times, leave all fields blank)
Then do the same for another user:
# adduser --disabled-password keyonlyuser
Create a script '/root/
#!/bin/sh
if [ "$1" = "keyonlyuser" ]; then
echo <key.pub from keyonlyuser e.g. ssh-ed25519 AAAdjakdjaskdajd>
fi
Go to the /etc/ssh/
Add at the top:
AuthorizedKeysC
AuthorizedKeysC
AuthorizedPrinc
AuthorizedPrinc
TrustedUserCAKeys /root/reproduce
Exit from the file and restart the ssh service:
# systemctl restart ssh
Use these commands to manifest the bug:
# ssh keyonlyuser@
# ssh otheruser@localhost -i /root/reproduce
Expected results: both ssh commands should succeed.
Actual results: the second ssh fails because the AuthorizedPrinc
[Where problems could occur]
* The patch itself modifies only the servconf.c, so regressions should be limited to the server configuration.
* Since the fix touches pointers, there might be regression related to memory handling and fetching data.
-------
Versions of OpenSSH from 8.7p1 to 9.3p1 contain the following code:
if (*activep && options-
However, this is executed for both authorized_
Related branches
- git-ubuntu bot: Approve
- Christian Ehrhardt (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 58 lines (+36/-0)3 files modifieddebian/changelog (+9/-0)
debian/patches/fix-authorized-principals-command.patch (+26/-0)
debian/patches/series (+1/-0)
- git-ubuntu bot: Approve
- Christian Ehrhardt (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 58 lines (+36/-0)3 files modifieddebian/changelog (+9/-0)
debian/patches/fix-authorized-principals-command.patch (+26/-0)
debian/patches/series (+1/-0)
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 66 lines (+44/-0)3 files modifieddebian/changelog (+9/-0)
debian/patches/fix-authorized-principals-command.patch (+34/-0)
debian/patches/series (+1/-0)
Changed in openssh (Ubuntu): | |
status: | New → Triaged |
tags: | added: bitesize |
tags: | added: server-todo |
Changed in openssh (Ubuntu Jammy): | |
status: | New → In Progress |
Changed in openssh (Ubuntu Lunar): | |
status: | New → In Progress |
Changed in openssh (Ubuntu Mantic): | |
status: | Triaged → In Progress |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: | removed: server-todo |
Upstream bug: https:/ /bugzilla. mindrot. org/show_ bug.cgi? id=3574