Skip to content

Commit

Permalink
CVE-2018-4700: Linux session cookies used a predictable random number…
Browse files Browse the repository at this point in the history
… seed.
  • Loading branch information
michaelrsweet committed Dec 7, 2018
1 parent 4fb44b2 commit feb4c62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
@@ -1,10 +1,11 @@
CHANGES - 2.2.10 - 2018-12-06
CHANGES - 2.2.10 - 2018-12-07
=============================


Changes in CUPS v2.2.10
-----------------------

- CVE-2018-4700: Linux session cookies used a predictable random number seed.
- The `lpoptions` command now works with IPP Everywhere printers that have not
yet been added as local queues (Issue #5045)
- Added USB quirk rules (Issue #5395, Issue #5443)
Expand Down
4 changes: 3 additions & 1 deletion cgi-bin/var.c
Expand Up @@ -1207,6 +1207,7 @@ cgi_set_sid(void)
const char *remote_addr, /* REMOTE_ADDR */
*server_name, /* SERVER_NAME */
*server_port; /* SERVER_PORT */
struct timeval curtime; /* Current time */


if ((remote_addr = getenv("REMOTE_ADDR")) == NULL)
Expand All @@ -1216,7 +1217,8 @@ cgi_set_sid(void)
if ((server_port = getenv("SERVER_PORT")) == NULL)
server_port = "SERVER_PORT";

CUPS_SRAND(time(NULL));
gettimeofday(&curtime, NULL);
CUPS_SRAND(curtime.tv_sec + curtime.tv_usec);
snprintf(buffer, sizeof(buffer), "%s:%s:%s:%02X%02X%02X%02X%02X%02X%02X%02X",
remote_addr, server_name, server_port,
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255,
Expand Down

0 comments on commit feb4c62

Please sign in to comment.