by fweimer · 3w ago · 0 comments
“ What a fascinating bug!! My wife has complained that open office will never print on Tuesdays!?! Then she demonstrated it. Sure enough, won't print on Tuesday. Other applications print. I think this is the same bug. Here is my guess:
Print to a postscript file. Observe the line: %%CreationDate: (Tue Mar 3 19:47:42 2009)
Change "Tue" to anything else: %%CreationDate: (XTue Mar 3 19:47:42 2009)
Save the file and it prints. Tools like evince work because they simply omit the "CreationDate" tag to begin with.
Now something odd happens when my cups script (I am using the Brother MFC420CN) copies the file to a temp file. Some of the code is rearranged, not sure how or why, but it uses a command called "file" to identify the file as "PostScript". This check would work on the original file you printed, but by the time it runs the check on the temp file, it misidentifies. Normally it would return:
PostScript document text conforming at level 3.0
But there is another check that happens before the PostScript check. If it finds "Tue" at the fourth byte of the file, it identifies it as: Jan 22 14:32:44 MET 1991\011Erlang JAM file - version 4.2
So it's not a problem w/ openoffice.org, cups, or the brother printer drivers. It is a bug in the `file` utility, and documented at https://bugs.launchpad.net/ubuntu/+source/file/+bug/248619.
”https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/255161...
OK but although I love the file utility, why does OpenOffice and/or CUPS rely on it to... print a file that ends with the .ps extension?
It's kinda begging for troubles.
Like I get that sometimes you have to do what you have to do, but sniffing should be a last resort.
An attacker might send a file that orders for millions of dollars of pizzas, using the fax hardware built into the printer (I’m not sure you can buy postscript printers that can fax today, but you can buy printers that can fax even today)
`sudo apt purge libcups*`
NB, don't do this on a system you're planning to keep operational, this will autoremove half the OS if allowed to run.
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
But now, I really want to know why my office suite needs to tell my printer what day of the week it is.
If the printer is smart enough to make use of that kind of information, then isn't it also smart enough to sort that out on its own? If so, then it seems superfluous.
And the whole CreationDate field is optional in PostScript[1], anyway.
[1]: https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf
this seems like a post-rationalization. when an app generates a file to send to another service, it's usually a good practice to timestamp that. unless you're severely bandwidth-constrained, putting a timestamp in your protocol almost always solves more problems than it creates. "we shouldn't include a timestamp because it might at some point trigger a date-math bug" is just not how software gets built.
If not, then: I'm not sure that the distinction means anything. :)