1

I am thinking of a scenario where unknown stream of data is printed to a terminal or terminal emulator, isn't it so that some sequences of characters may be interpreted as commands and cause damage?

Basically, I am wondering what are the potential consequences of dumping random or unknown sequence of octets to a terminal [emulator]? Using xterm as an example.

1
  • If you mean a string representing binary, I would go with no. If you are talking more along the lines of piping binary in, then maybe. Sep 24, 2013 at 16:45

3 Answers 3

2

There is potential danger. While in theory, dumping "garbage" to a terminal should do no harm, you never know if there is a bug in the code behind the terminal. A certain binary string could have unintended consequences.

1
  • 3
    Of course, that can be said about any piece of software, processing any type of data. Sep 25, 2013 at 11:24
1

There was an exposure in early versions of DOS where doing a DIR of a diskette could (if certain options were enabled for the system) cause commands to be executed off the diskette, potentially installing a virus. The key here was that a console display system was set up to interpret certain character combos as commands. I'm not aware of any "modern" DOS/Windows versions where this is true (outside of HTML, et al), but I know little about xterm et al (which to some degree simulate those old environments), and there could also be a similar danger in some GUI environments.

Way back in the Teletype days, you could damage some teleprinters by sending them "pure binary" data that would cause invalid mechanical sequences. No modern printers should have this problem (though of course the problem of sometimes printing page after page of essentially nothing remains to this day).

0

Files can be crafted which contain control characters. The control characters can be newline, backspace, anything in the ASCII table. If you want to be certain binary will do no harm, pipe it to | cat -v, or write a filter to catch the no-no's.

2
  • Could you add some information on what kind of harm we are looking at? Is there any danger of corrupting anything more than terminal display? That's what control characters could do? One can always reset the terminal though. Is there graver danger inherent here? May 1, 2017 at 16:43
  • I merely speculate that commands can be embedded (and executed), I have not tested it. I will try it.
    – user2497
    May 1, 2017 at 17:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .