NULL pointer dereference in `print_job()` during MIME auto-detection
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in scheduler/ipp.c at print_job() around the reported line 8867, then inspect send_document() and trace how each handles a NULL result from mimeFileType() and mimeType(). Check the nearby tests for MIME auto-detection and add coverage for both functions with no MIME definitions; done means neither path dereferences a missing MIME type and the scheduler continues handling the request.
Written by the indexing model from the issue text.
Description
Summary
An IPP client permitted to submit print jobs can crash cupsd if document auto-typing finds no MIME type and the configured MIME database cannot supply a fallback. The crash stops the scheduler, interrupting printing for all queues it serves.
Details
In scheduler/ipp.c, print_job() calls mimeFileType() to identify the document type and falls back to mimeType(). If both return NULL, it dereferences filetype in the log call and again in snprintf(). In the tested CUPS 2.4.19 build, the crash occurred in snprintf() at scheduler/ipp.c:8867.
In both tested configurations, cupsd continued accepting IPP requests without loading any MIME definitions. send_document() checks filetype before logging but still dereferences it in the following snprintf() call. Both code paths are present in CUPS 2.4.20 and at commit d473b41.
- Dominant language
- C
- Stars
- 1.8k
- Forks
- 362
- Avg merge
- 1d 46m
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenPrinting/cups
-
OAuth (bearer) quota check denies every user when the allowed-user list is emptyPossibly taken @RonitMehta08 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
OpenPrinting/cups#1795 · 1 comment ·
Maintainers usually reply within 1 day
-
cupsdGetPrivateAttrs: @ACL never grants access, and @OWNER is looked up as an operating-system group for non-ownersPossibly taken @user-Param claimed this 7 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
OpenPrinting/cups#1796 ·
Maintainers usually reply within 1 day
-
OAuth/OIDC token-validation gaps: nonce not enforced when absent, at_hash alg, inbound bearer not signature/aud/exp-validated + unverified email used for authzMay be free again @michaelrsweet claimed this 145 days ago, and no pull request is open. Openinvestigating
OpenPrinting/cups#1609 · 1 assignee ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 52/100
OpenPrinting/cups#1572 ·
Maintainers usually reply within 1 day
-
Fix OAuth authorization via web interfaceMay be free again @michaelrsweet claimed this 211 days ago, and no pull request is open. Openbug priority-high security
OpenPrinting/cups#1556 · 8 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in OpenPrinting/cups
Similar issues
-
`sha256()` returns a wrong hash when libsql-ffi is built with gcc 11 or laterPossibly taken @colinhacks claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tursodatabase/libsql#2333 ·
Maintainers usually reply within 11 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Backport to 3.0 advertises a suffix that does not existPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
389ds/389-ds-base#8152 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RetroAchievements/rcheevos#580 · 1 comment ·
Maintainers usually reply within 5 days
-
meta:feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
mpv-player/mpv#18855 · 2 comments ·
Maintainers usually reply within 1 day