CVE-2022-25643 (published 2022-02-24T15:15Z)

seatd-launch in seatd 0.6.x before 0.6.4 allows removing files with escalated privileges when installed setuid root. The attack vector is a user-supplied socket pathname.

Severity: HIGH
CVSS v2 base score: 9.3 (AV:N/AC:M/Au:N/C:C/I:C/A:C)
CVSS v3 base score: 9.8, CRITICAL (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-668
cwe_name: Exposure of Resource to Wrong Sphere
description: The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
extended_description: 
            Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
            A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system.
            In either case, the end result is that a resource has been exposed to the wrong party.
         
         

Fix information:
repo_url: https://github.com/kennylevinsen/seatd
commit_details: repo_url: https://github.com/kennylevinsen/seatd
author: Kenny Levinsen
author_date: 2022-02-21 11:46:48+01:00
msg: seatd-launch: Remove socket path command line arg

This should not need to be configured, so remove the argument. If
downstream prefers a different folder, the location can be made
compile-time configurable like for seatd itself.
repository: repo_url: https://github.com/kennylevinsen/seatd
repo_name: kennylevinsen/seatd
description: [mirror] Seat management daemon and library (https://sr.ht/~kennylevinsen/seatd)
repo_language: C
owner: kennylevinsen
file_changes: filename: seatd-launch.c
change_type: ModificationType.MODIFY
diff: @@ -15,18 +15,13 @@ int main(int argc, char *argv[]) {
 
 	const char *usage = "Usage: seatd-launch [options] [--] command\n"
 			    "\n"
-			    "  -h		Show this help message\n"
-			    "  -s <path>	Where to create the seatd socket\n"
-			    "  -v		Show the version number\n"
+			    "  -h	Show this help message\n"
+			    "  -v	Show the version number\n"
 			    "\n";
 
 	int c;
-	char *sockpath = NULL;
-	while ((c = getopt(argc, argv, "vhs:")) != -1) {
+	while ((c = getopt(argc, argv, "vh")) != -1) {
 		switch (c) {
-		case 's':
-			sockpath = optarg;
-			break;
 		case 'v':
 			printf("seatd-launch version %s\n", SEATD_VERSION);
 			return 0;
@@ -47,11 +42,8 @@ int main(int argc, char *argv[]) {
 	}
 	char **command = &argv[optind];
 
-	char sockbuf[256];
-	if (sockpath == NULL) {
-		sprintf(sockbuf, "/tmp/seatd.%d.sock", getpid());
-		sockpath = sockbuf;
-	}
+	char sockpath[256];
+	sprintf(sockpath, "/tmp/seatd.%d.sock", getpid());
 
 	int fds[2];
 	if (pipe(fds) == -1) {

programming_language: C