fedora 24
shell weakness #4

4

Weakness Breakdown


Definition:

A shell weakness occurs when a program enables an attacker to execute unexpected commands on the operating system.

Warning code(s):

This causes a new program to execute and is difficult to use safely.

File Name:

aj-snapshot-0.9.6/src/aj-snapshot.c

Context:

The highlighted line of code below is the trigger point of this particular Fedora 24 shell weakness.

         sigemptyset(&sig_hup_handler.sa_mask);
        sig_hup_handler.sa_flags = 0;

        sigaction(SIGINT, &sig_int_handler, NULL);
        sigaction(SIGTERM, &sig_int_handler, NULL);
        sigaction(SIGHUP, &sig_hup_handler, NULL);
    }

    // Get XML node first:

    switch (action){
        case STORE:
            xml_node = mxmlNewXML("1.0");
            break;
        case RESTORE:
        case DAEMON:
            xml_node = read_xml(filename, xml_node);
            break;
        default:
            break;
    }

    // Initialize clients with ALSA and JACK.

    if ((system & ALSA) == ALSA) {
        seq = alsa_initialize(seq);
        if (seq){
            system_ready |= ALSA;
        } 
        else {
            switch (action){
                case STORE:
                    VERBOSE("aj-snapshot: will NOT store ALSA connections!\n");
                    break;
                case RESTORE:
                case DAEMON:
                    VERBOSE("aj-snapshot: will NOT restore ALSA connections!\n");
                    break;
                case REMOVE_ONLY:
                    VERBOSE("aj-snapshot: will NOT remove ALSA connections!\n");
                    break;
                default:
                    break;
            }
            exit_success = 0;
        }
    }
    if ((system & JACK) == JACK) {
        jack_initialize(&jackc, (action == DAEMON));
        if(jackc){ 

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.