alpine 3.7
misc weakness #428

4

Weakness Breakdown


Definition:

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):

This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data.

File Name:

hylafax/src/hylafax-6.0.6/libhylafax/FaxClient.c++

Context:

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

     if (n == COMPLETE)
	state |= FS_LOGGEDIN;
    else
	state &= ~FS_LOGGEDIN;
    if (isLoggedIn()) {
	if (state&FS_TZPEND) {
	    u_int tz = tzone;
	    tzone = 0;
	    (void) setTimeZone(tz);
	    state &= ~FS_TZPEND;
	}
	return (true);
    } else {
	emsg = NLS::TEXT("Login failed: ") | lastResponse;
	return (false);
    }
}

/*
 * Prompt for a password.
 */
const char*
FaxClient::getPasswd(const char* prompt)
{
    return (getpass(prompt));
}

/*
 * Do admin login procedure.
 */
bool
FaxClient::admin(const char* pass, fxStr& emsg)
{
    if (command("ADMIN %s", pass ? pass : getpass("Password:")) != COMPLETE) {
	emsg = NLS::TEXT("Admin failed: ") | lastResponse;
	return (false);
    } else
	return (true);
}

bool
FaxClient::setCommon(FaxParam& parm, u_int v)
{
    if (v != this->*parm.pv) {
	if (0 < v && v < parm.NparmNames) {
	    if (command("%s %s", parm.cmd, parm.parmNames[v]) != COMPLETE) {
		printError("%s", (const char*) lastResponse);
		return (false);
	    }
	} else { 

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.