Live data from Hacker News

Show HN: Tetris in a PDF

th0mas.nl

211–220 of 238 posts

Re: Show HN: Tetris in a PDF

#211
post #72

Earlier quoted context omitted.

One should reject all PDF:s except /a-standards compliant ones.

Let me tell you about the lord and savior of the printing industry, the PDF/X standard...

It allows external sources. I think even the ICC profile can sit outside the document, as well as stuff like video.

I like the archivable series, the document comes with what is needed to render it.

Re: Show HN: Tetris in a PDF

#212

It's hard to overstate the ingenuity that went into this! Despite what people say in the comments here, both browsers really do not let you execute PDF JavaScript willy nilly. Outside of browser environments you are mostly safe anyway because JavaScript is rarely supported, with the big exception being Acrobat. The cleverness of pdftris is not so much Tetris in PDF but how it found its way around the restrictions tha…

You can manipulate form fields at anytime, and setInterval is provided so you can have things that run in an infinite loop. But yeah, as a first approximation, the only things js in pdf can do is mutate form fields and react to events related to form fields, unless your pdf reader is acrobat and that's something else entirely.

Re: Show HN: Tetris in a PDF

#213
post #161

Earlier quoted context omitted.

There is no recent version of Acrobat Reader for Linux, and old (was it 5.x beta?) versions rarely work on modern distros.

Acrobat 9.5 works fine on Linux, if a little slow. This Tetris game makes it crash though.

Oh, thanks, that's good to hear!

Edit: only now I see that's also from 2009 with updates into 2013. Do you where one can easily download the latest patched version?

Re: Show HN: Tetris in a PDF

#215
post #7

Not just web browsers, Acrobat (and probably other PDF readers) have supported executing Javascript in PDFs for decades.

why??? for what possible secure white hat reason could you want to run js in pdfs??!? is nobody sane running the pdf org?

Re: Show HN: Tetris in a PDF

#216
post #212

It's hard to overstate the ingenuity that went into this! Despite what people say in the comments here, both browsers really do not let you execute PDF JavaScript willy nilly. Outside of browser environments you are mostly safe anyway because JavaScript is rarely supported, with the big exception being Acrobat. The cleverness of pdftris is not so much Tetris in PDF but how it found its way around the restrictions tha…

You can manipulate form fields at anytime, and setInterval is provided so you can have things that run in an infinite loop. But yeah, as a first approximation, the only things js in pdf can do is mutate form fields and react to events related to form fields, unless your pdf reader is acrobat and that's something else entirely.

My point is that nothing runs without at least one initial user interaction - which makes a big difference for security.

I believe this is even true for Acrobat with default settings, because while you can trigger JavaScript when a document is opened (/OpenAction) Acrobat will ask for permission.

Re: Show HN: Tetris in a PDF

#217
A friend of mine once applied for a job with the local PT operator. For that, I finagled the PDF of his CV such that after a minute or so, one of the company's trains would drive over the page from left to right at the very bottom.

He never heard back from them.

Re: Show HN: Tetris in a PDF

#218
post #94

This is amazing and terrifying (I am a security engineer and parsing complex document formats is a never-ending treasure trove of vulnerabilities).

Theres a malaysian movie where the main premise is a hacker who uses pdf executions to steal one cent from every persons bank account. Its pretty interesting.

Do you know the name of the movie?

Re: Show HN: Tetris in a PDF

#219
post #212

Earlier quoted context omitted.

You can manipulate form fields at anytime, and setInterval is provided so you can have things that run in an infinite loop. But yeah, as a first approximation, the only things js in pdf can do is mutate form fields and react to events related to form fields, unless your pdf reader is acrobat and that's something else entirely.

My point is that nothing runs without at least one initial user interaction - which makes a big difference for security. I believe this is even true for Acrobat with default settings, because while you can trigger JavaScript when a document is opened (/OpenAction) Acrobat will ask for permission.

I think I got your point but might have expressed myself badly. The pdf can run js and messes with the display right at opening time, without any warning or ask for permission.
Post reply on HN