Summary
Cups logs data of free memory to the logging service AFTER the connection has been closed, when it should have logged the data right before.
Details
The exact cause of this issue is the function httpClose(con->http) being called in scheduler/client.c before
httpClose(con->http); cupsdLogClient(con, CUPSDLOGWARN, "IP lookup failed - connection from %s closed!", httpGetHostname(con->http, NULL, 0));
The problem is that httpClose always, provided its argument is not null, frees the pointer at the end of the call, only for cupsdLogClient to pass the pointer to httpGetHostname.
This issue happens in function cupsdAcceptClient if LogLevel is warn
or higher and in two scenarios:
- there is a double-lookup for the IP Address (
HostNameLookups Double
is set in cupsd.conf
) which fails to resolve,
- or if CUPS is compiled with TCP wrappers and the connection is refused by rules from
/etc/hosts.allow
and /etc/hosts.deny
.
Impact
This is a use-after-free bug, that impacts the entire cupsd process.
If you need an exploit scenario, consider: local (unprivileged) attacker who happens to be able to read the log using it to exfiltrate private keys and info from a privileged cups daemon
or simply denial-of-service by making it crash.
Fixed by commit
9809947
Summary
Cups logs data of free memory to the logging service AFTER the connection has been closed, when it should have logged the data right before.
Details
The exact cause of this issue is the function httpClose(con->http) being called in scheduler/client.c before
httpClose(con->http); cupsdLogClient(con, CUPSDLOGWARN, "IP lookup failed - connection from %s closed!", httpGetHostname(con->http, NULL, 0));
The problem is that httpClose always, provided its argument is not null, frees the pointer at the end of the call, only for cupsdLogClient to pass the pointer to httpGetHostname.
This issue happens in function cupsdAcceptClient if LogLevel is
warn
or higher and in two scenarios:HostNameLookups Double
is set incupsd.conf
) which fails to resolve,/etc/hosts.allow
and/etc/hosts.deny
.Impact
This is a use-after-free bug, that impacts the entire cupsd process.
If you need an exploit scenario, consider: local (unprivileged) attacker who happens to be able to read the log using it to exfiltrate private keys and info from a privileged cups daemon
or simply denial-of-service by making it crash.
Fixed by commit
9809947