centos 7
format weakness #15

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:

libcanberra-0.30/src/canberra.h

Context:

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

         CA_ERROR_TOOBIG = -8,
        CA_ERROR_NOTFOUND = -9,
        CA_ERROR_DESTROYED = -10,
        CA_ERROR_CANCELED = -11,
        CA_ERROR_NOTAVAILABLE = -12,
        CA_ERROR_ACCESS = -13,
        CA_ERROR_IO = -14,
        CA_ERROR_INTERNAL = -15,
        CA_ERROR_DISABLED = -16,
        CA_ERROR_FORKED = -17,
        CA_ERROR_DISCONNECTED = -18,
        _CA_ERROR_MAX = -19
};

/**
 * ca_proplist:
 *
 * A canberra property list object. Basically a hashtable.
 */
typedef struct ca_proplist ca_proplist;

int ca_proplist_create(ca_proplist **p);
int ca_proplist_destroy(ca_proplist *p);
int ca_proplist_sets(ca_proplist *p, const char *key, const char *value);
int ca_proplist_setf(ca_proplist *p, const char *key, const char *format, ...) __attribute__((format(printf, 3, 4)));
int ca_proplist_set(ca_proplist *p, const char *key, const void *data, size_t nbytes);

int ca_context_create(ca_context **c);
int ca_context_set_driver(ca_context *c, const char *driver);
int ca_context_change_device(ca_context *c, const char *device);
int ca_context_open(ca_context *c);
int ca_context_destroy(ca_context *c);
int ca_context_change_props(ca_context *c, ...) __attribute__((sentinel));
int ca_context_change_props_full(ca_context *c, ca_proplist *p);
int ca_context_play_full(ca_context *c, uint32_t id, ca_proplist *p, ca_finish_callback_t cb, void *userdata);
int ca_context_play(ca_context *c, uint32_t id, ...) __attribute__((sentinel));
int ca_context_cache_full(ca_context *c, ca_proplist *p);
int ca_context_cache(ca_context *c, ...) __attribute__((sentinel));
int ca_context_cancel(ca_context *c, uint32_t id);
int ca_context_playing(ca_context *c, uint32_t id, int *playing);

const char *ca_strerror(int code);

#ifdef __cplusplus
}
#endif

#endif 

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.