alpine 3.9
misc weakness #440


Weakness Breakdown


The software specifies permissions for a security-critical resource in a way that allows the resource to be read or modified by unintended actors.

Warning code(s):

It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin.

File Name:



The highlighted line of code below is the trigger point of this particular Alpine 3.9 misc weakness.

 	client->input = i_stream_create_fd(client->fd_in, MAX_INBUF_SIZE);
	client->output = o_stream_create_fd(client->fd_out, (size_t)-1);
	client->io = io_add(client->fd_in, IO_READ, client_input, client);
	o_stream_set_flush_callback(client->output, client_output, client);

	if (client->debug) {
		i_debug("Worker activated for access by user '%s' using service '%s'",
			client->access_user, client->access_service);

static void imap_urlauth_worker_die(void)
	/* do nothing */

static void main_stdio_run(const char *access_user,
			   const char *const *access_applications)
	bool debug;

	debug = getenv("DEBUG") != NULL;
	access_user = access_user != NULL ? access_user : getenv("USER");
	if (access_user == NULL && IS_STANDALONE())
		access_user = getlogin();
	if (access_user == NULL)
		i_fatal("USER environment missing");

	(void)client_create_standalone(access_user, access_applications,
				       STDIN_FILENO, STDOUT_FILENO, debug);

static void client_connected(struct master_service_connection *conn)

int main(int argc, char *argv[])
	static const struct setting_parser_info *set_roots[] = {
	enum master_service_flags service_flags = 0;
	enum mail_storage_service_flags storage_service_flags =
	ARRAY_TYPE (const_string) access_apps;
	const char *access_user = NULL; 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.