HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Hamled
mazda-format-string-bug
C2022–2022
Hamled / mazda-format-string-bug

mazda-format-string-bug

printf format string bug in Mazda Connect Infotainment System

3Distinct people
3Mentions
0Explicit recommenders
15GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

printf format string bug in Mazda Connect Infotainment System

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour3 dated mentions

Observed mentions: 2022-02-09 07:21:38 UTC to 2022-02-09 08:25:42 UTC.

0122022-02-09 07:00:00 UTC to 2022-02-09 08:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsFeb 9, 07:002022-02-09 08:00:00 UTC to 2022-02-09 09:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsFeb 9, 08:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Feb 9, 07:002022-02-09 07:00:00 UTC2022-02-09 08:00:00 UTC202
Feb 9, 08:002022-02-09 08:00:00 UTC2022-02-09 09:00:00 UTC101

What Hacker News says

3 sources
This is so weird. I read [1] which someone linked to, and it all seems to make sense. But it doeesn't! I tried compiling this with gcc 11.2.0: #include <stdio.h> int main(void) { printf("%99 Invisible", NULL); return 0; } And it won't compile. I get: test.c: In function ‘main’: test.c:5:14: warning: unknown conversion type character ‘ ’ in format [- Wformat=] 5 | printf("%99 Invisible", NULL); | ^ test.c:5:10: warning: too many arguments for format [-Wformat-extra-args] 5 | printf("%99 Invisible", NULL); | ^~~~~~~~~~~~~~~ which I would expect; you can't have a field width (the "99") and then the space-padding flag; flags go first. Also I can't find any coverage of %I (capital 'I', as in "Invisible") in the manual page for printf(3)
Read the rest
on that system but that might just be an old manual page, GCC does seem to recognize it. Removing the cruft and trying plain %In gives a warning, but I guess whoever built the car's radio UI ignores warnings. I guess it's possible that the system doesn't use a standard-compliant enough C library, so it's printf() implementation does something ... creative with this string. Anyway, classic case of the lovely foot-gunnery that is %n in the wild! Sorry for all the car owners, of course. :/ EDIT: A commenter pointed out that the above are "just warnings", oops. :) More oops on me for not spelling the freaking title correctly, of course it's "99%" and not "%99" .. .need more coffee, clearly. Sorry. For people less used to C, the error here more or less seems to boil down to passing an untrusted string as the special "format string" for the printf() function. That function will interpret the contents of the string, and the percent symbol is how its special formatting directives start. Characters following a percent symbol will cause it to do stuff. The proper fix is usally to change printf(string); to printf("%s", string); or use some other I/O function altogether. The above simply says "here's a string", by using the programmer-selected string "%s" as the format, instead of the untrusted string coming from the outside. [1] https://github.com/Hamled/mazda-format-string-bug#readme
In Thousands of Mazdas in the Seattle area are stuck on a single FM radio station

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.