Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Integer overflow in httpGetDateTime()

Open
#1,717 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@michaelrsweet is already working on this.

Since Sep 24, 2026.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
security

Research direction

The bug is in cups/http-support.c lines 769-807 in the httpGetDateTime() function. Start by examining the sscanf parsing and the subsequent arithmetic for overflow. Write a test that passes extreme date values to trigger the overflow. Verify the fix by building CUPS and running the HTTP date parsing tests.

Written by the indexing model from the issue text.

Description

bug priority-low

Problem:
httpGetDateTime() in cups/http-support.c parses an HTTP date with sscanf() and only rejects a year above 9999 - day, hour, min, sec and the lower bound of year are not checked at all. The unchecked values overflow in int arithmetic at "leap_days[i] + day - 1", "normal_days[i] + day - 1", "(year - 1970) * 365" and "hour * 3600" / "min * 60".

https://github.com/OpenPrinting/cups/blob/e72b70245fbe81242a959be0ed1cbfc9dbefcd9a/cups/http-support.c#L769-L807

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Reporter: Pavel Nekrasov ([email protected]).

Dominant language
C
Stars
1.8k
Forks
341
Avg merge
15h 28m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenPrinting/cups

All issues in OpenPrinting/cups

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.