centos 7
format weakness #1

4

Weakness Breakdown


Definition:

A format string exploit occurs when the data of an input string is evaluated as a command by the program. This class of attacks is very similar to buffer overflows since an attacker could execute code, read the stack or cause new behaviors that compromise security. Learn more about format string attacks on OWASP attack index.

Warning code(s):

If format strings can be influenced by an attacker, they can be exploited.

File Name:

at-spi-1.32.0/test/app.c

Context:

The highlighted line of code below is the trigger point of this particular Centos 7 format weakness.

         if (!bonobo_init (&argc, argv))
          {
            g_error ("Could not initialize Bonobo");
          }

        /* Create the accesssible application server object */
        g_snprintf(sbuf, APP_STATIC_BUFF_SZ, "application-%s", argv[0]);

        atko = g_object_new (atk_object_get_type(), NULL);
        atk_object_set_name (atko, sbuf);
        atk_object_set_description( atko, "test application for accessibility SPI");
        app = spi_application_new(atko);

        /* Create the SpiAccessible 'source' for the event */
        accessible = spi_accessible_new (atko);
        fprintf(stderr, "accessible created.\n");

        e.source = bonobo_object_corba_objref ( bonobo_object (accessible));
        e.type = CORBA_string_dup ("focus:");

        obj_id = "OAFIID:Accessibility_Registry:1.0";

        oclient = bonobo_activation_activate_from_id (obj_id, 0, NULL, &ev);
        if (ev._major != CORBA_NO_EXCEPTION) {
                fprintf(stderr,
                ("Accessibility app error: exception during registry activation from id: %s\n"),
                        CORBA_exception_id(&ev));
                CORBA_exception_free(&ev);
                exit(-1);
        }

        if (CORBA_Object_is_nil (oclient, &ev))
          {
            g_error ("Could not locate registry");
          }

        registry = (Accessibility_Registry) oclient;

        Accessibility_Registry_registerApplication (registry,
                                                    bonobo_object_corba_objref (bonobo_object (app)),
                                                    &ev);
        fprintf(stderr, "registerApplication has been called.\n");

        Accessibility_Registry_notifyEvent (registry, &e, &ev);
        fprintf (stderr, "notify event has been called.\n");

        bonobo_main (); /* needed when app becomes a server ? */
        exit(0);
} 

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.