alpine 3.7
crypto weakness #299

4

Weakness Breakdown


Definition:

This weakness involves creating non-standard or non-tested algorithms, using weak algorithms or applying cryptographic algorithms incorrectly. Algorithms that were once considered safe are commonly later found to be unsafe, as the algorithms were broken.

Warning code(s):

The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment.

File Name:

mkinitfs/src/mkinitfs-3.2.0/nlplug-findfs.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.7 crypto weakness.

 
int main(int argc, char *argv[])
{
	struct pollfd fds[3];
	int numfds = 3;
	int r;
	struct ueventconf conf;
	int event_count = 0;
	size_t total_bytes = 0;
	int not_found_is_ok = 0;
	char *program_argv[2] = {0,0};
	sigset_t sigchldmask;

	for (r = 0; environ[r]; r++) {
		if (envcmp(environ[r], "PATH"))
			default_envp[0] = environ[r];
	}

	spawn_init(&spawnmgr);

	memset(&conf, 0, sizeof(conf));
	pthread_mutex_init(&conf.trigger_mutex, NULL);
	pthread_cond_init(&conf.trigger_cond, NULL);
	list_init(&conf.trigger_list);
	pthread_mutex_init(&conf.crypt.mutex, NULL);

	conf.program_argv = program_argv;
	conf.timeout = MAX_EVENT_TIMEOUT;
	conf.usb_storage_timeout = 0;
	conf.uevent_timeout = DEFAULT_EVENT_TIMEOUT;
	use_lvm = access(LVM_PATH, X_OK) == 0;
	use_mdadm = access(MDADM_PATH, X_OK) == 0;
	use_zpool = access(ZPOOL_PATH, X_OK) == 0;

	argv0 = strrchr(argv[0], '/');
	if (argv0++ == NULL)
		argv0 = argv[0];

	ARGBEGIN {
	case 'a':
		conf.apkovls = EARGF(usage(1));;
		break;
	case 'b':
		conf.bootrepos = EARGF(usage(1));
		break;
	case 'c':
		conf.crypt.data.device = EARGF(usage(1));
		break;
	case 'H':
		conf.crypt.header.device = EARGF(usage(1)); 

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.