write says write: effective gid does not match group of /dev/pts/5

Bug #2064685 reported by Robert Dinse
256
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I am logged in as 'nanook', I am in the tty group:
id
uid=2000(nanook) gid=1000(shell) groups=1000(shell),4(adm),5(tty),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),128(sambashare),135(lxd)
Yet when I say,
write nanook
I get
write: effective gid does not match group of /dev/pts/5
ls -l /dev/pts/5
crw--w---- 1 nanook tty 136, 5 May 2 18:51 /dev/pts/5
So something is wrong. And since it seems to involve permissions there may be security issues.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: util-linux 2.37.2-4ubuntu3.4
ProcVersionSignature: Ubuntu 5.15.0-102.112-generic 5.15.148
Uname: Linux 5.15.0-102-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: MATE
Date: Thu May 2 18:47:55 2024
SourcePackage: util-linux
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Robert Dinse (nanook) wrote :
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Hello Robert, I believe this is intentional.

If you wish to restore the previous behavior, it should be sufficient to change /usr/bin/write.ul to root:tty 02755.

Thanks

Changed in util-linux (Ubuntu):
status: New → Confirmed
information type: Private Security → Public Security
Revision history for this message
Alex Murray (alexmurray) wrote :

For context, this change was introduced in https://ubuntu.com/security/notices/USN-6719-2

Revision history for this message
Robert Dinse (nanook) wrote :

This does not really fix security because one aspect of security is availability to legitimate users and this breaks the latter. Seems there are better ways to fix such as restricting what this can write to with apparmor? Or just fixing the coding so it does parse the input more carefully.

To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.