Is it ever safe to open a suspicious HTML file (e.g. email attachment)? The Next CEO of Stack OverflowHow do I safely inspect a suspicious email attachment?Have i been phished?What vulnerability is this malicious document attempting to exploitWhy do email programs block xml files?One of my open files turned into a list of URLs and codes after clicking a link on a phishing email?Fake PayPal email with (presumably) malicious JS codeUsing Noscript while opening linksMy company sent a phishing email - can they see if I saved the attachment?Accidently opened a phishing email, is my computer infected by malware?How can I securely edit an Office file that I downloaded from the Internet?

How a 64-bit process virtual address space is divided in Linux?

Powershell. How to parse gci Name?

Need help understanding a power circuit (caps and diodes)

Why isn't acceleration always zero whenever velocity is zero, such as the moment a ball bounces off a wall?

What did we know about the Kessel run before the prequels?

Is there a way to save my career from absolute disaster?

0 rank tensor vs 1D vector

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

Can we say or write : "No, it'sn't"?

How to place nodes around a circle from some initial angle?

Does soap repel water?

How to count occurrences of text in a file?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

RigExpert AA-35 - Interpreting The Information

Is it professional to write unrelated content in an almost-empty email?

Would a completely good Muggle be able to use a wand?

Can MTA send mail via a relay without being told so?

Why do airplanes bank sharply to the right after air-to-air refueling?

Running a General Election and the European Elections together

Method for adding error messages to a dictionary given a key

Is a distribution that is normal, but highly skewed considered Gaussian?

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

Why this way of making earth uninhabitable in Interstellar?



Is it ever safe to open a suspicious HTML file (e.g. email attachment)?



The Next CEO of Stack OverflowHow do I safely inspect a suspicious email attachment?Have i been phished?What vulnerability is this malicious document attempting to exploitWhy do email programs block xml files?One of my open files turned into a list of URLs and codes after clicking a link on a phishing email?Fake PayPal email with (presumably) malicious JS codeUsing Noscript while opening linksMy company sent a phishing email - can they see if I saved the attachment?Accidently opened a phishing email, is my computer infected by malware?How can I securely edit an Office file that I downloaded from the Internet?










26















If I receive an email that has an attachment called something like safe-link.html would it ever be safe to open this file?



Clearly, HTML files may have malicious scripts embedded that could run when opened with a browser. However, I'm wondering if any breaches could occur upon downloading the file and then opening it in Notepad / other basic text editor rather than a web browser?



Background



I'm only asking because the company I work for like to send out 'test' phishing emails from time to time, and the latest had an HTML attachment. I suspected the email immediately (so didn't click to open the attachment in a browser), but I was intrigued to see if it actually was another test!



So I opened the file with Notepad and saw the first few lines "If this wasn't just a test, your computer would be compromised!". After informing colleagues that it was another test, they were extremely concerned that I had interacted with the file at all.



I'm reasonably confident that any malicious script would have to be opened in a web browser for it to have any effect.



Are my colleagues being too cautious, or was I being overzealous?



I'm an advocate of "better safe than sorry", so I don't think they were wrong not to open it; I just also don't believe it was completely unsafe to open with something like Notepad. I am very intrigued to find out!



"Gotchas" I'm aware of:



I believe editing it in a more complex website development tool (that actually renders the page in a preview) could be dangerous.



Also, I'm aware that simply double clicking the file (even if the default "open with" is set to be a text editor) could be dangerous. This is because something like readme.txt could actually be readme.txt.exe with file extensions hidden in something like Windows File Explorer.










share|improve this question















migrated from serverfault.com yesterday


This question came from our site for system and network administrators.













  • 12





    All these answers are way to extreme. If you want to open a html file in a text editor go ahead, as long as there is nothing executable with it.

    – Putvi
    yesterday






  • 1





    A famous example is AnnaKournikova.jpg.vbs (Anna Kournikova (computer virus))

    – Peter Mortensen
    21 hours ago






  • 2





    @PeterMortensen : A VBS file is not an HTML file…

    – Jerry B
    14 hours ago











  • Yes. It the file is a test, and you open it, and see that it is a test, then you may be tempted to tell others. Thus destroying the efficacy of the test. Also if people are being punished for making mistakes, then your company can not learn; mistakes will be covered up.

    – ctrl-alt-delor
    7 hours ago






  • 1





    "Is it ever safe to open a suspicious HTML file?" Absolutely, as long as the file is simply suspicious and not malicious. :-)

    – owacoder
    5 hours ago
















26















If I receive an email that has an attachment called something like safe-link.html would it ever be safe to open this file?



Clearly, HTML files may have malicious scripts embedded that could run when opened with a browser. However, I'm wondering if any breaches could occur upon downloading the file and then opening it in Notepad / other basic text editor rather than a web browser?



Background



I'm only asking because the company I work for like to send out 'test' phishing emails from time to time, and the latest had an HTML attachment. I suspected the email immediately (so didn't click to open the attachment in a browser), but I was intrigued to see if it actually was another test!



So I opened the file with Notepad and saw the first few lines "If this wasn't just a test, your computer would be compromised!". After informing colleagues that it was another test, they were extremely concerned that I had interacted with the file at all.



I'm reasonably confident that any malicious script would have to be opened in a web browser for it to have any effect.



Are my colleagues being too cautious, or was I being overzealous?



I'm an advocate of "better safe than sorry", so I don't think they were wrong not to open it; I just also don't believe it was completely unsafe to open with something like Notepad. I am very intrigued to find out!



"Gotchas" I'm aware of:



I believe editing it in a more complex website development tool (that actually renders the page in a preview) could be dangerous.



Also, I'm aware that simply double clicking the file (even if the default "open with" is set to be a text editor) could be dangerous. This is because something like readme.txt could actually be readme.txt.exe with file extensions hidden in something like Windows File Explorer.










share|improve this question















migrated from serverfault.com yesterday


This question came from our site for system and network administrators.













  • 12





    All these answers are way to extreme. If you want to open a html file in a text editor go ahead, as long as there is nothing executable with it.

    – Putvi
    yesterday






  • 1





    A famous example is AnnaKournikova.jpg.vbs (Anna Kournikova (computer virus))

    – Peter Mortensen
    21 hours ago






  • 2





    @PeterMortensen : A VBS file is not an HTML file…

    – Jerry B
    14 hours ago











  • Yes. It the file is a test, and you open it, and see that it is a test, then you may be tempted to tell others. Thus destroying the efficacy of the test. Also if people are being punished for making mistakes, then your company can not learn; mistakes will be covered up.

    – ctrl-alt-delor
    7 hours ago






  • 1





    "Is it ever safe to open a suspicious HTML file?" Absolutely, as long as the file is simply suspicious and not malicious. :-)

    – owacoder
    5 hours ago














26












26








26


4






If I receive an email that has an attachment called something like safe-link.html would it ever be safe to open this file?



Clearly, HTML files may have malicious scripts embedded that could run when opened with a browser. However, I'm wondering if any breaches could occur upon downloading the file and then opening it in Notepad / other basic text editor rather than a web browser?



Background



I'm only asking because the company I work for like to send out 'test' phishing emails from time to time, and the latest had an HTML attachment. I suspected the email immediately (so didn't click to open the attachment in a browser), but I was intrigued to see if it actually was another test!



So I opened the file with Notepad and saw the first few lines "If this wasn't just a test, your computer would be compromised!". After informing colleagues that it was another test, they were extremely concerned that I had interacted with the file at all.



I'm reasonably confident that any malicious script would have to be opened in a web browser for it to have any effect.



Are my colleagues being too cautious, or was I being overzealous?



I'm an advocate of "better safe than sorry", so I don't think they were wrong not to open it; I just also don't believe it was completely unsafe to open with something like Notepad. I am very intrigued to find out!



"Gotchas" I'm aware of:



I believe editing it in a more complex website development tool (that actually renders the page in a preview) could be dangerous.



Also, I'm aware that simply double clicking the file (even if the default "open with" is set to be a text editor) could be dangerous. This is because something like readme.txt could actually be readme.txt.exe with file extensions hidden in something like Windows File Explorer.










share|improve this question
















If I receive an email that has an attachment called something like safe-link.html would it ever be safe to open this file?



Clearly, HTML files may have malicious scripts embedded that could run when opened with a browser. However, I'm wondering if any breaches could occur upon downloading the file and then opening it in Notepad / other basic text editor rather than a web browser?



Background



I'm only asking because the company I work for like to send out 'test' phishing emails from time to time, and the latest had an HTML attachment. I suspected the email immediately (so didn't click to open the attachment in a browser), but I was intrigued to see if it actually was another test!



So I opened the file with Notepad and saw the first few lines "If this wasn't just a test, your computer would be compromised!". After informing colleagues that it was another test, they were extremely concerned that I had interacted with the file at all.



I'm reasonably confident that any malicious script would have to be opened in a web browser for it to have any effect.



Are my colleagues being too cautious, or was I being overzealous?



I'm an advocate of "better safe than sorry", so I don't think they were wrong not to open it; I just also don't believe it was completely unsafe to open with something like Notepad. I am very intrigued to find out!



"Gotchas" I'm aware of:



I believe editing it in a more complex website development tool (that actually renders the page in a preview) could be dangerous.



Also, I'm aware that simply double clicking the file (even if the default "open with" is set to be a text editor) could be dangerous. This is because something like readme.txt could actually be readme.txt.exe with file extensions hidden in something like Windows File Explorer.







email malware phishing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 6 hours ago









Peter Mortensen

70649




70649










asked yesterday









UPChooUPChoo

13123




13123




migrated from serverfault.com yesterday


This question came from our site for system and network administrators.









migrated from serverfault.com yesterday


This question came from our site for system and network administrators.









  • 12





    All these answers are way to extreme. If you want to open a html file in a text editor go ahead, as long as there is nothing executable with it.

    – Putvi
    yesterday






  • 1





    A famous example is AnnaKournikova.jpg.vbs (Anna Kournikova (computer virus))

    – Peter Mortensen
    21 hours ago






  • 2





    @PeterMortensen : A VBS file is not an HTML file…

    – Jerry B
    14 hours ago











  • Yes. It the file is a test, and you open it, and see that it is a test, then you may be tempted to tell others. Thus destroying the efficacy of the test. Also if people are being punished for making mistakes, then your company can not learn; mistakes will be covered up.

    – ctrl-alt-delor
    7 hours ago






  • 1





    "Is it ever safe to open a suspicious HTML file?" Absolutely, as long as the file is simply suspicious and not malicious. :-)

    – owacoder
    5 hours ago













  • 12





    All these answers are way to extreme. If you want to open a html file in a text editor go ahead, as long as there is nothing executable with it.

    – Putvi
    yesterday






  • 1





    A famous example is AnnaKournikova.jpg.vbs (Anna Kournikova (computer virus))

    – Peter Mortensen
    21 hours ago






  • 2





    @PeterMortensen : A VBS file is not an HTML file…

    – Jerry B
    14 hours ago











  • Yes. It the file is a test, and you open it, and see that it is a test, then you may be tempted to tell others. Thus destroying the efficacy of the test. Also if people are being punished for making mistakes, then your company can not learn; mistakes will be covered up.

    – ctrl-alt-delor
    7 hours ago






  • 1





    "Is it ever safe to open a suspicious HTML file?" Absolutely, as long as the file is simply suspicious and not malicious. :-)

    – owacoder
    5 hours ago








12




12





All these answers are way to extreme. If you want to open a html file in a text editor go ahead, as long as there is nothing executable with it.

– Putvi
yesterday





All these answers are way to extreme. If you want to open a html file in a text editor go ahead, as long as there is nothing executable with it.

– Putvi
yesterday




1




1





A famous example is AnnaKournikova.jpg.vbs (Anna Kournikova (computer virus))

– Peter Mortensen
21 hours ago





A famous example is AnnaKournikova.jpg.vbs (Anna Kournikova (computer virus))

– Peter Mortensen
21 hours ago




2




2





@PeterMortensen : A VBS file is not an HTML file…

– Jerry B
14 hours ago





@PeterMortensen : A VBS file is not an HTML file…

– Jerry B
14 hours ago













Yes. It the file is a test, and you open it, and see that it is a test, then you may be tempted to tell others. Thus destroying the efficacy of the test. Also if people are being punished for making mistakes, then your company can not learn; mistakes will be covered up.

– ctrl-alt-delor
7 hours ago





Yes. It the file is a test, and you open it, and see that it is a test, then you may be tempted to tell others. Thus destroying the efficacy of the test. Also if people are being punished for making mistakes, then your company can not learn; mistakes will be covered up.

– ctrl-alt-delor
7 hours ago




1




1





"Is it ever safe to open a suspicious HTML file?" Absolutely, as long as the file is simply suspicious and not malicious. :-)

– owacoder
5 hours ago






"Is it ever safe to open a suspicious HTML file?" Absolutely, as long as the file is simply suspicious and not malicious. :-)

– owacoder
5 hours ago











6 Answers
6






active

oldest

votes


















23














Editors, and common libraries used by editors, may have vulnerabilities like buffer overflows. Your attacker would need to know (or guess) what editor you use and craft an exploit specifically for that editor (different editors are unlikely to have the same vulnerabilities unless the vulnerability resides in a library they have in common). An attack may be aimed at a popular editor and send out to as many people as possible, essentially turning it into a "spray-n-pray" attack.




Attack Surface



A very simple editor like Microsoft's Notepad has a smaller attack surface than a more advanced editor (like Visual Studio Code). More code generally means more potential vulnerabilities.




Mitigations



Certain mitigation techniques like Address Space Layout Randomization (ASLR), Data Execution Prevention and having an anti-virus with an "exploit blocker" (these are generally capable of recognizing basic overflow attacks, among others) may help to render certain attacks useless.



Software Updates



All of these techniques are of course no substitute to keeping your software (ALL your software I might add) up-to-date. Keeping your software updated is the best security strategy one can have. This is sometimes overlooked or trivialized due to its lack of feedback. An anti-virus yelling at you that "You are protected!" sends out a much stronger signal than a software update that silently patches vulnerabilities in the background. I tend to compare an anti-virus program with a person sticking their fingers in the holes of a dike to prevent the water coming through. It does its best to keep the flood out but chances are it's not going to have enough fingers to fill all the holes (or miss a few altogether). Software patches fixes those holes.




Bottom Line



You can never be sure you aren't going to have a bad day by opening any type of file in any type of program. However, some programs (like editors) are much harder to attack due to their small footprint or secure design and therefore are less likely to be targeted for mass attacks (especially because an attacker is likely to assume their evil .html file is going to be opened in a browser, not in an editor).






share|improve this answer










New contributor




Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 3





    Buffer overflow in a text editor?

    – Putvi
    yesterday






  • 5





    @Putvi Why the surprise? The primary function of a text editor is to manipulate buffers, it's very easy to sneak in buffer overflows if you're not careful.

    – Cubic
    yesterday






  • 8





    I have never heard of an attack against a text editor. It is certainly in the realm of possibility, but I would be very surprised to see a practical example of it.

    – Max
    yesterday






  • 7





    @Putvi: Here's the list of vulnerabilities for vim : cvedetails.com/vulnerability-list/vendor_id-8218/opec-1/… . It lists quite a few...

    – sleske
    23 hours ago






  • 12





    @Numeri: This one for example: cvedetails.com/cve/CVE-2016-1248 - "execution of arbitrary code if a file with a specially crafted modeline is opened". So just opening a file is enough.

    – sleske
    22 hours ago


















11














Oh, these answers are way too sophisticated for your situation. It's highly unlikely that your IT department would be using some fancy workaround assuming they know what editor you're using, their point is not to actually mess up your systems. Notepad isn't going to be doing anything with any image or attachment, no matter what, and the text you saw certainly didn't do anything reprehensible to your system. Nor would it have been likely to, even if it had been a real attack, as editors are very personal tools and there are lots and lots of them that'd have to be covered for anything like this to have any sort of detectable effect.



Tell your coworkers to get off your back, and to be more careful themselves. Let me just point out that you dug yourself into this hole though, and achieved the opposite of what was intended... If you hadn't announced that you looked and what you saw, people who clearly don't know a thing about IT security wouldn't be harassing you and feeling superior about it. Instead, some of them would have opened the attachment and seen the message, and gotten a bit chastened themselves. So you've messed up IT's test all the way down the line, emphasizing the Dunner-Kruger effect which is no doubt the cause of sending out these tests. Stop it!






share|improve this answer























  • I do not think this answer is useful. The question is about the security implications of opening such a file in a text editor. And if what you're working on is important enough, it is well possible that you get such targeted attacks. And if you're just a generic person, it is still possible the receive a file that targets notepad++ (at least in theory. I don't know any vulns)

    – lucidbrot
    12 hours ago


















5














In general it's not safe because if you get a suspicious or unexpected email, whatever the attachment is, it shouldn't be opened. That's the safest thing to do. Especially if you are on Windows, which is notorious for executing stuff when it should not, and which is the most targeted OS by attackers, running the most targeted applications.



But if you want to open it anyway, maybe because you are an INFOSEC enthusiast or you think you are (or want to be) smarter than the average user, here's some advice:



  • Consider reading the source code of the email, instead of opening it. You might be able to do so directly from the webmail interface, or by reading the text files on your server, etc.

  • Consider downloading the attachment from the source, by copying and pasting its base64 representation. This will just be simple ASCII text. You can then convert it back to binary with some tools.

  • Consider renaming the file, saving it as potentially-malicious.txt instead of .html or whatever name and extension it has.

  • Consider opening the txt file with very basic text editors, or even hex-editors, or even with very simple basic tools available on the command line that will only display ASCII characters. An example could be cat file.txt | less on Linux. (Note: why cat before less? Because I noticed that less parses and converts some stuff by default sometimes, like converting PDFs to TXTs. So just be careful, better check what the commands do by default on your system anyway).

  • Consider opening the file in virtual machine, which should be up-to-date and also disconnected from the network.

  • Consider doing most of this at home and never tell your boss or your colleagues about it. They might see it as dangerous behavior, a violation of the security policy, or something that might cause you trouble anyway.





share|improve this answer


















  • 1





    You want to unset LESSOPEN and LESSCLOSE at the very least if you use less. Also, it might be better to use cat -v to avoid exploiting unicode or control code handling vulnerabilities in your terminal emulator.

    – forest
    18 hours ago



















2














Its situations like this, where risk for particular objects is an unknown quantity, that a strongly compartmentalized OS like Qubes excels. Qubes uses a hardened bare-metal hypervisor to keep risky stuff isolated from sensitive areas (like personal files and the core OS). It even isolates risky devices. This isolation is expressed and controlled through the GUI in a fairly user-friendly fashion:



Disposable VM context menu



In the above example, right-clicking on an html file in KDE Dolphin lets you choose options like "Edit In DisposableVM" and "View In DisposableVM". Clicking on either one of these will automatically instantiate a disposable virtual machine (dispvm), then send the file to the dispvm and load it in the associated app. This takes only seconds. When you're done with the editing app, the edited version will be returned to the calling VM and the dispvm will be instantly destroyed. Note, however, this process by itself does not make an untrusted file into a trusted file.



For certain file types (currently images and pdfs) there is also a menu option for converting a file to a trusted state... i.e. a dispvm is used to process an untrusted pdf and construct a sanitized version that is loaded back and can be used without risk to your regular VMs where you normally work. This is possible because the originating sanitizing tool accepts only the most predictable representation of the requested data back from the dispvm, such as uncompressed bitmaps of exactly an expected number of pixels and bytes; once the raw sanitized version is received back, it is then re-compressed into the expected format.



Its worth noting that you could emulate the type of security described above using more familiar tools like VirtualBox and VMware, but the degree and quality of the isolation is unlikely to match the levels attained by a dedicated system like Qubes.






share|improve this answer






























    2














    Okay, so, technically, you're never 100% safe. Yes, there could be attempted attacks on your text editor/ASCII viewer. Yes, someone could have somehow magically snuck a DLL into your temporary directory in order to mess with MS Notepad delay loading.



    But in practice, when you receive an HTML file in a phishing email, it's going to contain some malicious JavaScript or more likely redirect you to a website online that tries to persuade you to hand over your credit card details / logins.



    So, in practice, examining such a file in Notepad++ is a perfectly reasonable way to see what's been sent to you. The reaction of your colleagues seems unfair, unless you are working in a nuclear silo … and if your job is really that mission/safety critical, why are there emails at all? Why would there be internet access? And, if there isn't, why would you need phishing audits/tests/honeypots? Someone somewhere is being overly paranoid.



    We can try to reduce our risk to zero but the only way to achieve that is to not use a computer.



    All that being said, though, you will always have to deal with silly people so perhaps keep this activity to yourself next time. ;)






    share|improve this answer






























      1














      Yes, breaches could occur upon downloading the file and then opening it in Notepad / other basic widely-used text editor, because payloads can be specifically crafted to interact upon such editors as Notepad.



      Example: Notepad.exe, like many of the Windows programs, uses system libraries. One of those system libraries loads shdocvw.dll (Internet Explorer related component). shdocvw.dll has a delay-load dependency on a library called 'ieshims.dll'.



      This .dll could be searched in the current directory and loaded from there. So if an attacker would deploy it along with the .txt file, it could use this setup as an exploit to load its .dll and then go from there.



      The solution to this: use your own text editor/viewer that is not dependent on any Windows components / libraries. Mine is just called Edit.ExE, 100% independent of any external resources and 100% safe regarding processed content (reads everything directly as ASCII / text with no content detection). You don't have one; use a very obscure one no one would bother to exploit.






      share|improve this answer




















      • 16





        "This .dll could be searched in the current directory and loaded from there." So if the only thing that's in the directory of the html file is that html file, then you're not exposed to this attack? Seems like an easier fix than writing your own text viewer.

        – UKMonkey
        yesterday






      • 13





        "100% independent of any external resources " - so you read the file by direct access to the disk sectors, in case your OS is compromised? And you don't even use the OS to load Edit.ExE, in case it was compromised to recognize that file name as being an obvious name for a file editor? Security is one thing, but paranoia is something else.

        – alephzero
        yesterday






      • 6





        Are you really advocating for security through obscurity? -1

        – forest
        19 hours ago











      • @alephzero : I think the point is that this email attachment couldn't have compromised his editor before he has opened it, and his editor doesn't rely on other code that is inherently compromised.

        – Jerry B
        14 hours ago






      • 1





        It's theoretically possible. But it's also possible that you get hacked without doing anything, including downloading the file. If you want to prevent this possibility, it is more practical to write a program to insert an underscore after each character, which would destroy most malicious code, and open it with a familiar editor.

        – user23013
        9 hours ago











      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "162"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsecurity.stackexchange.com%2fquestions%2f206364%2fis-it-ever-safe-to-open-a-suspicious-html-file-e-g-email-attachment%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      6 Answers
      6






      active

      oldest

      votes








      6 Answers
      6






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      23














      Editors, and common libraries used by editors, may have vulnerabilities like buffer overflows. Your attacker would need to know (or guess) what editor you use and craft an exploit specifically for that editor (different editors are unlikely to have the same vulnerabilities unless the vulnerability resides in a library they have in common). An attack may be aimed at a popular editor and send out to as many people as possible, essentially turning it into a "spray-n-pray" attack.




      Attack Surface



      A very simple editor like Microsoft's Notepad has a smaller attack surface than a more advanced editor (like Visual Studio Code). More code generally means more potential vulnerabilities.




      Mitigations



      Certain mitigation techniques like Address Space Layout Randomization (ASLR), Data Execution Prevention and having an anti-virus with an "exploit blocker" (these are generally capable of recognizing basic overflow attacks, among others) may help to render certain attacks useless.



      Software Updates



      All of these techniques are of course no substitute to keeping your software (ALL your software I might add) up-to-date. Keeping your software updated is the best security strategy one can have. This is sometimes overlooked or trivialized due to its lack of feedback. An anti-virus yelling at you that "You are protected!" sends out a much stronger signal than a software update that silently patches vulnerabilities in the background. I tend to compare an anti-virus program with a person sticking their fingers in the holes of a dike to prevent the water coming through. It does its best to keep the flood out but chances are it's not going to have enough fingers to fill all the holes (or miss a few altogether). Software patches fixes those holes.




      Bottom Line



      You can never be sure you aren't going to have a bad day by opening any type of file in any type of program. However, some programs (like editors) are much harder to attack due to their small footprint or secure design and therefore are less likely to be targeted for mass attacks (especially because an attacker is likely to assume their evil .html file is going to be opened in a browser, not in an editor).






      share|improve this answer










      New contributor




      Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.















      • 3





        Buffer overflow in a text editor?

        – Putvi
        yesterday






      • 5





        @Putvi Why the surprise? The primary function of a text editor is to manipulate buffers, it's very easy to sneak in buffer overflows if you're not careful.

        – Cubic
        yesterday






      • 8





        I have never heard of an attack against a text editor. It is certainly in the realm of possibility, but I would be very surprised to see a practical example of it.

        – Max
        yesterday






      • 7





        @Putvi: Here's the list of vulnerabilities for vim : cvedetails.com/vulnerability-list/vendor_id-8218/opec-1/… . It lists quite a few...

        – sleske
        23 hours ago






      • 12





        @Numeri: This one for example: cvedetails.com/cve/CVE-2016-1248 - "execution of arbitrary code if a file with a specially crafted modeline is opened". So just opening a file is enough.

        – sleske
        22 hours ago















      23














      Editors, and common libraries used by editors, may have vulnerabilities like buffer overflows. Your attacker would need to know (or guess) what editor you use and craft an exploit specifically for that editor (different editors are unlikely to have the same vulnerabilities unless the vulnerability resides in a library they have in common). An attack may be aimed at a popular editor and send out to as many people as possible, essentially turning it into a "spray-n-pray" attack.




      Attack Surface



      A very simple editor like Microsoft's Notepad has a smaller attack surface than a more advanced editor (like Visual Studio Code). More code generally means more potential vulnerabilities.




      Mitigations



      Certain mitigation techniques like Address Space Layout Randomization (ASLR), Data Execution Prevention and having an anti-virus with an "exploit blocker" (these are generally capable of recognizing basic overflow attacks, among others) may help to render certain attacks useless.



      Software Updates



      All of these techniques are of course no substitute to keeping your software (ALL your software I might add) up-to-date. Keeping your software updated is the best security strategy one can have. This is sometimes overlooked or trivialized due to its lack of feedback. An anti-virus yelling at you that "You are protected!" sends out a much stronger signal than a software update that silently patches vulnerabilities in the background. I tend to compare an anti-virus program with a person sticking their fingers in the holes of a dike to prevent the water coming through. It does its best to keep the flood out but chances are it's not going to have enough fingers to fill all the holes (or miss a few altogether). Software patches fixes those holes.




      Bottom Line



      You can never be sure you aren't going to have a bad day by opening any type of file in any type of program. However, some programs (like editors) are much harder to attack due to their small footprint or secure design and therefore are less likely to be targeted for mass attacks (especially because an attacker is likely to assume their evil .html file is going to be opened in a browser, not in an editor).






      share|improve this answer










      New contributor




      Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.















      • 3





        Buffer overflow in a text editor?

        – Putvi
        yesterday






      • 5





        @Putvi Why the surprise? The primary function of a text editor is to manipulate buffers, it's very easy to sneak in buffer overflows if you're not careful.

        – Cubic
        yesterday






      • 8





        I have never heard of an attack against a text editor. It is certainly in the realm of possibility, but I would be very surprised to see a practical example of it.

        – Max
        yesterday






      • 7





        @Putvi: Here's the list of vulnerabilities for vim : cvedetails.com/vulnerability-list/vendor_id-8218/opec-1/… . It lists quite a few...

        – sleske
        23 hours ago






      • 12





        @Numeri: This one for example: cvedetails.com/cve/CVE-2016-1248 - "execution of arbitrary code if a file with a specially crafted modeline is opened". So just opening a file is enough.

        – sleske
        22 hours ago













      23












      23








      23







      Editors, and common libraries used by editors, may have vulnerabilities like buffer overflows. Your attacker would need to know (or guess) what editor you use and craft an exploit specifically for that editor (different editors are unlikely to have the same vulnerabilities unless the vulnerability resides in a library they have in common). An attack may be aimed at a popular editor and send out to as many people as possible, essentially turning it into a "spray-n-pray" attack.




      Attack Surface



      A very simple editor like Microsoft's Notepad has a smaller attack surface than a more advanced editor (like Visual Studio Code). More code generally means more potential vulnerabilities.




      Mitigations



      Certain mitigation techniques like Address Space Layout Randomization (ASLR), Data Execution Prevention and having an anti-virus with an "exploit blocker" (these are generally capable of recognizing basic overflow attacks, among others) may help to render certain attacks useless.



      Software Updates



      All of these techniques are of course no substitute to keeping your software (ALL your software I might add) up-to-date. Keeping your software updated is the best security strategy one can have. This is sometimes overlooked or trivialized due to its lack of feedback. An anti-virus yelling at you that "You are protected!" sends out a much stronger signal than a software update that silently patches vulnerabilities in the background. I tend to compare an anti-virus program with a person sticking their fingers in the holes of a dike to prevent the water coming through. It does its best to keep the flood out but chances are it's not going to have enough fingers to fill all the holes (or miss a few altogether). Software patches fixes those holes.




      Bottom Line



      You can never be sure you aren't going to have a bad day by opening any type of file in any type of program. However, some programs (like editors) are much harder to attack due to their small footprint or secure design and therefore are less likely to be targeted for mass attacks (especially because an attacker is likely to assume their evil .html file is going to be opened in a browser, not in an editor).






      share|improve this answer










      New contributor




      Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      Editors, and common libraries used by editors, may have vulnerabilities like buffer overflows. Your attacker would need to know (or guess) what editor you use and craft an exploit specifically for that editor (different editors are unlikely to have the same vulnerabilities unless the vulnerability resides in a library they have in common). An attack may be aimed at a popular editor and send out to as many people as possible, essentially turning it into a "spray-n-pray" attack.




      Attack Surface



      A very simple editor like Microsoft's Notepad has a smaller attack surface than a more advanced editor (like Visual Studio Code). More code generally means more potential vulnerabilities.




      Mitigations



      Certain mitigation techniques like Address Space Layout Randomization (ASLR), Data Execution Prevention and having an anti-virus with an "exploit blocker" (these are generally capable of recognizing basic overflow attacks, among others) may help to render certain attacks useless.



      Software Updates



      All of these techniques are of course no substitute to keeping your software (ALL your software I might add) up-to-date. Keeping your software updated is the best security strategy one can have. This is sometimes overlooked or trivialized due to its lack of feedback. An anti-virus yelling at you that "You are protected!" sends out a much stronger signal than a software update that silently patches vulnerabilities in the background. I tend to compare an anti-virus program with a person sticking their fingers in the holes of a dike to prevent the water coming through. It does its best to keep the flood out but chances are it's not going to have enough fingers to fill all the holes (or miss a few altogether). Software patches fixes those holes.




      Bottom Line



      You can never be sure you aren't going to have a bad day by opening any type of file in any type of program. However, some programs (like editors) are much harder to attack due to their small footprint or secure design and therefore are less likely to be targeted for mass attacks (especially because an attacker is likely to assume their evil .html file is going to be opened in a browser, not in an editor).







      share|improve this answer










      New contributor




      Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this answer



      share|improve this answer








      edited yesterday





















      New contributor




      Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      answered yesterday









      ThomasThomas

      3313




      3313




      New contributor




      Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      • 3





        Buffer overflow in a text editor?

        – Putvi
        yesterday






      • 5





        @Putvi Why the surprise? The primary function of a text editor is to manipulate buffers, it's very easy to sneak in buffer overflows if you're not careful.

        – Cubic
        yesterday






      • 8





        I have never heard of an attack against a text editor. It is certainly in the realm of possibility, but I would be very surprised to see a practical example of it.

        – Max
        yesterday






      • 7





        @Putvi: Here's the list of vulnerabilities for vim : cvedetails.com/vulnerability-list/vendor_id-8218/opec-1/… . It lists quite a few...

        – sleske
        23 hours ago






      • 12





        @Numeri: This one for example: cvedetails.com/cve/CVE-2016-1248 - "execution of arbitrary code if a file with a specially crafted modeline is opened". So just opening a file is enough.

        – sleske
        22 hours ago












      • 3





        Buffer overflow in a text editor?

        – Putvi
        yesterday






      • 5





        @Putvi Why the surprise? The primary function of a text editor is to manipulate buffers, it's very easy to sneak in buffer overflows if you're not careful.

        – Cubic
        yesterday






      • 8





        I have never heard of an attack against a text editor. It is certainly in the realm of possibility, but I would be very surprised to see a practical example of it.

        – Max
        yesterday






      • 7





        @Putvi: Here's the list of vulnerabilities for vim : cvedetails.com/vulnerability-list/vendor_id-8218/opec-1/… . It lists quite a few...

        – sleske
        23 hours ago






      • 12





        @Numeri: This one for example: cvedetails.com/cve/CVE-2016-1248 - "execution of arbitrary code if a file with a specially crafted modeline is opened". So just opening a file is enough.

        – sleske
        22 hours ago







      3




      3





      Buffer overflow in a text editor?

      – Putvi
      yesterday





      Buffer overflow in a text editor?

      – Putvi
      yesterday




      5




      5





      @Putvi Why the surprise? The primary function of a text editor is to manipulate buffers, it's very easy to sneak in buffer overflows if you're not careful.

      – Cubic
      yesterday





      @Putvi Why the surprise? The primary function of a text editor is to manipulate buffers, it's very easy to sneak in buffer overflows if you're not careful.

      – Cubic
      yesterday




      8




      8





      I have never heard of an attack against a text editor. It is certainly in the realm of possibility, but I would be very surprised to see a practical example of it.

      – Max
      yesterday





      I have never heard of an attack against a text editor. It is certainly in the realm of possibility, but I would be very surprised to see a practical example of it.

      – Max
      yesterday




      7




      7





      @Putvi: Here's the list of vulnerabilities for vim : cvedetails.com/vulnerability-list/vendor_id-8218/opec-1/… . It lists quite a few...

      – sleske
      23 hours ago





      @Putvi: Here's the list of vulnerabilities for vim : cvedetails.com/vulnerability-list/vendor_id-8218/opec-1/… . It lists quite a few...

      – sleske
      23 hours ago




      12




      12





      @Numeri: This one for example: cvedetails.com/cve/CVE-2016-1248 - "execution of arbitrary code if a file with a specially crafted modeline is opened". So just opening a file is enough.

      – sleske
      22 hours ago





      @Numeri: This one for example: cvedetails.com/cve/CVE-2016-1248 - "execution of arbitrary code if a file with a specially crafted modeline is opened". So just opening a file is enough.

      – sleske
      22 hours ago













      11














      Oh, these answers are way too sophisticated for your situation. It's highly unlikely that your IT department would be using some fancy workaround assuming they know what editor you're using, their point is not to actually mess up your systems. Notepad isn't going to be doing anything with any image or attachment, no matter what, and the text you saw certainly didn't do anything reprehensible to your system. Nor would it have been likely to, even if it had been a real attack, as editors are very personal tools and there are lots and lots of them that'd have to be covered for anything like this to have any sort of detectable effect.



      Tell your coworkers to get off your back, and to be more careful themselves. Let me just point out that you dug yourself into this hole though, and achieved the opposite of what was intended... If you hadn't announced that you looked and what you saw, people who clearly don't know a thing about IT security wouldn't be harassing you and feeling superior about it. Instead, some of them would have opened the attachment and seen the message, and gotten a bit chastened themselves. So you've messed up IT's test all the way down the line, emphasizing the Dunner-Kruger effect which is no doubt the cause of sending out these tests. Stop it!






      share|improve this answer























      • I do not think this answer is useful. The question is about the security implications of opening such a file in a text editor. And if what you're working on is important enough, it is well possible that you get such targeted attacks. And if you're just a generic person, it is still possible the receive a file that targets notepad++ (at least in theory. I don't know any vulns)

        – lucidbrot
        12 hours ago















      11














      Oh, these answers are way too sophisticated for your situation. It's highly unlikely that your IT department would be using some fancy workaround assuming they know what editor you're using, their point is not to actually mess up your systems. Notepad isn't going to be doing anything with any image or attachment, no matter what, and the text you saw certainly didn't do anything reprehensible to your system. Nor would it have been likely to, even if it had been a real attack, as editors are very personal tools and there are lots and lots of them that'd have to be covered for anything like this to have any sort of detectable effect.



      Tell your coworkers to get off your back, and to be more careful themselves. Let me just point out that you dug yourself into this hole though, and achieved the opposite of what was intended... If you hadn't announced that you looked and what you saw, people who clearly don't know a thing about IT security wouldn't be harassing you and feeling superior about it. Instead, some of them would have opened the attachment and seen the message, and gotten a bit chastened themselves. So you've messed up IT's test all the way down the line, emphasizing the Dunner-Kruger effect which is no doubt the cause of sending out these tests. Stop it!






      share|improve this answer























      • I do not think this answer is useful. The question is about the security implications of opening such a file in a text editor. And if what you're working on is important enough, it is well possible that you get such targeted attacks. And if you're just a generic person, it is still possible the receive a file that targets notepad++ (at least in theory. I don't know any vulns)

        – lucidbrot
        12 hours ago













      11












      11








      11







      Oh, these answers are way too sophisticated for your situation. It's highly unlikely that your IT department would be using some fancy workaround assuming they know what editor you're using, their point is not to actually mess up your systems. Notepad isn't going to be doing anything with any image or attachment, no matter what, and the text you saw certainly didn't do anything reprehensible to your system. Nor would it have been likely to, even if it had been a real attack, as editors are very personal tools and there are lots and lots of them that'd have to be covered for anything like this to have any sort of detectable effect.



      Tell your coworkers to get off your back, and to be more careful themselves. Let me just point out that you dug yourself into this hole though, and achieved the opposite of what was intended... If you hadn't announced that you looked and what you saw, people who clearly don't know a thing about IT security wouldn't be harassing you and feeling superior about it. Instead, some of them would have opened the attachment and seen the message, and gotten a bit chastened themselves. So you've messed up IT's test all the way down the line, emphasizing the Dunner-Kruger effect which is no doubt the cause of sending out these tests. Stop it!






      share|improve this answer













      Oh, these answers are way too sophisticated for your situation. It's highly unlikely that your IT department would be using some fancy workaround assuming they know what editor you're using, their point is not to actually mess up your systems. Notepad isn't going to be doing anything with any image or attachment, no matter what, and the text you saw certainly didn't do anything reprehensible to your system. Nor would it have been likely to, even if it had been a real attack, as editors are very personal tools and there are lots and lots of them that'd have to be covered for anything like this to have any sort of detectable effect.



      Tell your coworkers to get off your back, and to be more careful themselves. Let me just point out that you dug yourself into this hole though, and achieved the opposite of what was intended... If you hadn't announced that you looked and what you saw, people who clearly don't know a thing about IT security wouldn't be harassing you and feeling superior about it. Instead, some of them would have opened the attachment and seen the message, and gotten a bit chastened themselves. So you've messed up IT's test all the way down the line, emphasizing the Dunner-Kruger effect which is no doubt the cause of sending out these tests. Stop it!







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered 22 hours ago









      George MGeorge M

      24115




      24115












      • I do not think this answer is useful. The question is about the security implications of opening such a file in a text editor. And if what you're working on is important enough, it is well possible that you get such targeted attacks. And if you're just a generic person, it is still possible the receive a file that targets notepad++ (at least in theory. I don't know any vulns)

        – lucidbrot
        12 hours ago

















      • I do not think this answer is useful. The question is about the security implications of opening such a file in a text editor. And if what you're working on is important enough, it is well possible that you get such targeted attacks. And if you're just a generic person, it is still possible the receive a file that targets notepad++ (at least in theory. I don't know any vulns)

        – lucidbrot
        12 hours ago
















      I do not think this answer is useful. The question is about the security implications of opening such a file in a text editor. And if what you're working on is important enough, it is well possible that you get such targeted attacks. And if you're just a generic person, it is still possible the receive a file that targets notepad++ (at least in theory. I don't know any vulns)

      – lucidbrot
      12 hours ago





      I do not think this answer is useful. The question is about the security implications of opening such a file in a text editor. And if what you're working on is important enough, it is well possible that you get such targeted attacks. And if you're just a generic person, it is still possible the receive a file that targets notepad++ (at least in theory. I don't know any vulns)

      – lucidbrot
      12 hours ago











      5














      In general it's not safe because if you get a suspicious or unexpected email, whatever the attachment is, it shouldn't be opened. That's the safest thing to do. Especially if you are on Windows, which is notorious for executing stuff when it should not, and which is the most targeted OS by attackers, running the most targeted applications.



      But if you want to open it anyway, maybe because you are an INFOSEC enthusiast or you think you are (or want to be) smarter than the average user, here's some advice:



      • Consider reading the source code of the email, instead of opening it. You might be able to do so directly from the webmail interface, or by reading the text files on your server, etc.

      • Consider downloading the attachment from the source, by copying and pasting its base64 representation. This will just be simple ASCII text. You can then convert it back to binary with some tools.

      • Consider renaming the file, saving it as potentially-malicious.txt instead of .html or whatever name and extension it has.

      • Consider opening the txt file with very basic text editors, or even hex-editors, or even with very simple basic tools available on the command line that will only display ASCII characters. An example could be cat file.txt | less on Linux. (Note: why cat before less? Because I noticed that less parses and converts some stuff by default sometimes, like converting PDFs to TXTs. So just be careful, better check what the commands do by default on your system anyway).

      • Consider opening the file in virtual machine, which should be up-to-date and also disconnected from the network.

      • Consider doing most of this at home and never tell your boss or your colleagues about it. They might see it as dangerous behavior, a violation of the security policy, or something that might cause you trouble anyway.





      share|improve this answer


















      • 1





        You want to unset LESSOPEN and LESSCLOSE at the very least if you use less. Also, it might be better to use cat -v to avoid exploiting unicode or control code handling vulnerabilities in your terminal emulator.

        – forest
        18 hours ago
















      5














      In general it's not safe because if you get a suspicious or unexpected email, whatever the attachment is, it shouldn't be opened. That's the safest thing to do. Especially if you are on Windows, which is notorious for executing stuff when it should not, and which is the most targeted OS by attackers, running the most targeted applications.



      But if you want to open it anyway, maybe because you are an INFOSEC enthusiast or you think you are (or want to be) smarter than the average user, here's some advice:



      • Consider reading the source code of the email, instead of opening it. You might be able to do so directly from the webmail interface, or by reading the text files on your server, etc.

      • Consider downloading the attachment from the source, by copying and pasting its base64 representation. This will just be simple ASCII text. You can then convert it back to binary with some tools.

      • Consider renaming the file, saving it as potentially-malicious.txt instead of .html or whatever name and extension it has.

      • Consider opening the txt file with very basic text editors, or even hex-editors, or even with very simple basic tools available on the command line that will only display ASCII characters. An example could be cat file.txt | less on Linux. (Note: why cat before less? Because I noticed that less parses and converts some stuff by default sometimes, like converting PDFs to TXTs. So just be careful, better check what the commands do by default on your system anyway).

      • Consider opening the file in virtual machine, which should be up-to-date and also disconnected from the network.

      • Consider doing most of this at home and never tell your boss or your colleagues about it. They might see it as dangerous behavior, a violation of the security policy, or something that might cause you trouble anyway.





      share|improve this answer


















      • 1





        You want to unset LESSOPEN and LESSCLOSE at the very least if you use less. Also, it might be better to use cat -v to avoid exploiting unicode or control code handling vulnerabilities in your terminal emulator.

        – forest
        18 hours ago














      5












      5








      5







      In general it's not safe because if you get a suspicious or unexpected email, whatever the attachment is, it shouldn't be opened. That's the safest thing to do. Especially if you are on Windows, which is notorious for executing stuff when it should not, and which is the most targeted OS by attackers, running the most targeted applications.



      But if you want to open it anyway, maybe because you are an INFOSEC enthusiast or you think you are (or want to be) smarter than the average user, here's some advice:



      • Consider reading the source code of the email, instead of opening it. You might be able to do so directly from the webmail interface, or by reading the text files on your server, etc.

      • Consider downloading the attachment from the source, by copying and pasting its base64 representation. This will just be simple ASCII text. You can then convert it back to binary with some tools.

      • Consider renaming the file, saving it as potentially-malicious.txt instead of .html or whatever name and extension it has.

      • Consider opening the txt file with very basic text editors, or even hex-editors, or even with very simple basic tools available on the command line that will only display ASCII characters. An example could be cat file.txt | less on Linux. (Note: why cat before less? Because I noticed that less parses and converts some stuff by default sometimes, like converting PDFs to TXTs. So just be careful, better check what the commands do by default on your system anyway).

      • Consider opening the file in virtual machine, which should be up-to-date and also disconnected from the network.

      • Consider doing most of this at home and never tell your boss or your colleagues about it. They might see it as dangerous behavior, a violation of the security policy, or something that might cause you trouble anyway.





      share|improve this answer













      In general it's not safe because if you get a suspicious or unexpected email, whatever the attachment is, it shouldn't be opened. That's the safest thing to do. Especially if you are on Windows, which is notorious for executing stuff when it should not, and which is the most targeted OS by attackers, running the most targeted applications.



      But if you want to open it anyway, maybe because you are an INFOSEC enthusiast or you think you are (or want to be) smarter than the average user, here's some advice:



      • Consider reading the source code of the email, instead of opening it. You might be able to do so directly from the webmail interface, or by reading the text files on your server, etc.

      • Consider downloading the attachment from the source, by copying and pasting its base64 representation. This will just be simple ASCII text. You can then convert it back to binary with some tools.

      • Consider renaming the file, saving it as potentially-malicious.txt instead of .html or whatever name and extension it has.

      • Consider opening the txt file with very basic text editors, or even hex-editors, or even with very simple basic tools available on the command line that will only display ASCII characters. An example could be cat file.txt | less on Linux. (Note: why cat before less? Because I noticed that less parses and converts some stuff by default sometimes, like converting PDFs to TXTs. So just be careful, better check what the commands do by default on your system anyway).

      • Consider opening the file in virtual machine, which should be up-to-date and also disconnected from the network.

      • Consider doing most of this at home and never tell your boss or your colleagues about it. They might see it as dangerous behavior, a violation of the security policy, or something that might cause you trouble anyway.






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered yesterday









      reedreed

      2,9393825




      2,9393825







      • 1





        You want to unset LESSOPEN and LESSCLOSE at the very least if you use less. Also, it might be better to use cat -v to avoid exploiting unicode or control code handling vulnerabilities in your terminal emulator.

        – forest
        18 hours ago













      • 1





        You want to unset LESSOPEN and LESSCLOSE at the very least if you use less. Also, it might be better to use cat -v to avoid exploiting unicode or control code handling vulnerabilities in your terminal emulator.

        – forest
        18 hours ago








      1




      1





      You want to unset LESSOPEN and LESSCLOSE at the very least if you use less. Also, it might be better to use cat -v to avoid exploiting unicode or control code handling vulnerabilities in your terminal emulator.

      – forest
      18 hours ago






      You want to unset LESSOPEN and LESSCLOSE at the very least if you use less. Also, it might be better to use cat -v to avoid exploiting unicode or control code handling vulnerabilities in your terminal emulator.

      – forest
      18 hours ago












      2














      Its situations like this, where risk for particular objects is an unknown quantity, that a strongly compartmentalized OS like Qubes excels. Qubes uses a hardened bare-metal hypervisor to keep risky stuff isolated from sensitive areas (like personal files and the core OS). It even isolates risky devices. This isolation is expressed and controlled through the GUI in a fairly user-friendly fashion:



      Disposable VM context menu



      In the above example, right-clicking on an html file in KDE Dolphin lets you choose options like "Edit In DisposableVM" and "View In DisposableVM". Clicking on either one of these will automatically instantiate a disposable virtual machine (dispvm), then send the file to the dispvm and load it in the associated app. This takes only seconds. When you're done with the editing app, the edited version will be returned to the calling VM and the dispvm will be instantly destroyed. Note, however, this process by itself does not make an untrusted file into a trusted file.



      For certain file types (currently images and pdfs) there is also a menu option for converting a file to a trusted state... i.e. a dispvm is used to process an untrusted pdf and construct a sanitized version that is loaded back and can be used without risk to your regular VMs where you normally work. This is possible because the originating sanitizing tool accepts only the most predictable representation of the requested data back from the dispvm, such as uncompressed bitmaps of exactly an expected number of pixels and bytes; once the raw sanitized version is received back, it is then re-compressed into the expected format.



      Its worth noting that you could emulate the type of security described above using more familiar tools like VirtualBox and VMware, but the degree and quality of the isolation is unlikely to match the levels attained by a dedicated system like Qubes.






      share|improve this answer



























        2














        Its situations like this, where risk for particular objects is an unknown quantity, that a strongly compartmentalized OS like Qubes excels. Qubes uses a hardened bare-metal hypervisor to keep risky stuff isolated from sensitive areas (like personal files and the core OS). It even isolates risky devices. This isolation is expressed and controlled through the GUI in a fairly user-friendly fashion:



        Disposable VM context menu



        In the above example, right-clicking on an html file in KDE Dolphin lets you choose options like "Edit In DisposableVM" and "View In DisposableVM". Clicking on either one of these will automatically instantiate a disposable virtual machine (dispvm), then send the file to the dispvm and load it in the associated app. This takes only seconds. When you're done with the editing app, the edited version will be returned to the calling VM and the dispvm will be instantly destroyed. Note, however, this process by itself does not make an untrusted file into a trusted file.



        For certain file types (currently images and pdfs) there is also a menu option for converting a file to a trusted state... i.e. a dispvm is used to process an untrusted pdf and construct a sanitized version that is loaded back and can be used without risk to your regular VMs where you normally work. This is possible because the originating sanitizing tool accepts only the most predictable representation of the requested data back from the dispvm, such as uncompressed bitmaps of exactly an expected number of pixels and bytes; once the raw sanitized version is received back, it is then re-compressed into the expected format.



        Its worth noting that you could emulate the type of security described above using more familiar tools like VirtualBox and VMware, but the degree and quality of the isolation is unlikely to match the levels attained by a dedicated system like Qubes.






        share|improve this answer

























          2












          2








          2







          Its situations like this, where risk for particular objects is an unknown quantity, that a strongly compartmentalized OS like Qubes excels. Qubes uses a hardened bare-metal hypervisor to keep risky stuff isolated from sensitive areas (like personal files and the core OS). It even isolates risky devices. This isolation is expressed and controlled through the GUI in a fairly user-friendly fashion:



          Disposable VM context menu



          In the above example, right-clicking on an html file in KDE Dolphin lets you choose options like "Edit In DisposableVM" and "View In DisposableVM". Clicking on either one of these will automatically instantiate a disposable virtual machine (dispvm), then send the file to the dispvm and load it in the associated app. This takes only seconds. When you're done with the editing app, the edited version will be returned to the calling VM and the dispvm will be instantly destroyed. Note, however, this process by itself does not make an untrusted file into a trusted file.



          For certain file types (currently images and pdfs) there is also a menu option for converting a file to a trusted state... i.e. a dispvm is used to process an untrusted pdf and construct a sanitized version that is loaded back and can be used without risk to your regular VMs where you normally work. This is possible because the originating sanitizing tool accepts only the most predictable representation of the requested data back from the dispvm, such as uncompressed bitmaps of exactly an expected number of pixels and bytes; once the raw sanitized version is received back, it is then re-compressed into the expected format.



          Its worth noting that you could emulate the type of security described above using more familiar tools like VirtualBox and VMware, but the degree and quality of the isolation is unlikely to match the levels attained by a dedicated system like Qubes.






          share|improve this answer













          Its situations like this, where risk for particular objects is an unknown quantity, that a strongly compartmentalized OS like Qubes excels. Qubes uses a hardened bare-metal hypervisor to keep risky stuff isolated from sensitive areas (like personal files and the core OS). It even isolates risky devices. This isolation is expressed and controlled through the GUI in a fairly user-friendly fashion:



          Disposable VM context menu



          In the above example, right-clicking on an html file in KDE Dolphin lets you choose options like "Edit In DisposableVM" and "View In DisposableVM". Clicking on either one of these will automatically instantiate a disposable virtual machine (dispvm), then send the file to the dispvm and load it in the associated app. This takes only seconds. When you're done with the editing app, the edited version will be returned to the calling VM and the dispvm will be instantly destroyed. Note, however, this process by itself does not make an untrusted file into a trusted file.



          For certain file types (currently images and pdfs) there is also a menu option for converting a file to a trusted state... i.e. a dispvm is used to process an untrusted pdf and construct a sanitized version that is loaded back and can be used without risk to your regular VMs where you normally work. This is possible because the originating sanitizing tool accepts only the most predictable representation of the requested data back from the dispvm, such as uncompressed bitmaps of exactly an expected number of pixels and bytes; once the raw sanitized version is received back, it is then re-compressed into the expected format.



          Its worth noting that you could emulate the type of security described above using more familiar tools like VirtualBox and VMware, but the degree and quality of the isolation is unlikely to match the levels attained by a dedicated system like Qubes.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 8 hours ago









          taskettasket

          713




          713





















              2














              Okay, so, technically, you're never 100% safe. Yes, there could be attempted attacks on your text editor/ASCII viewer. Yes, someone could have somehow magically snuck a DLL into your temporary directory in order to mess with MS Notepad delay loading.



              But in practice, when you receive an HTML file in a phishing email, it's going to contain some malicious JavaScript or more likely redirect you to a website online that tries to persuade you to hand over your credit card details / logins.



              So, in practice, examining such a file in Notepad++ is a perfectly reasonable way to see what's been sent to you. The reaction of your colleagues seems unfair, unless you are working in a nuclear silo … and if your job is really that mission/safety critical, why are there emails at all? Why would there be internet access? And, if there isn't, why would you need phishing audits/tests/honeypots? Someone somewhere is being overly paranoid.



              We can try to reduce our risk to zero but the only way to achieve that is to not use a computer.



              All that being said, though, you will always have to deal with silly people so perhaps keep this activity to yourself next time. ;)






              share|improve this answer



























                2














                Okay, so, technically, you're never 100% safe. Yes, there could be attempted attacks on your text editor/ASCII viewer. Yes, someone could have somehow magically snuck a DLL into your temporary directory in order to mess with MS Notepad delay loading.



                But in practice, when you receive an HTML file in a phishing email, it's going to contain some malicious JavaScript or more likely redirect you to a website online that tries to persuade you to hand over your credit card details / logins.



                So, in practice, examining such a file in Notepad++ is a perfectly reasonable way to see what's been sent to you. The reaction of your colleagues seems unfair, unless you are working in a nuclear silo … and if your job is really that mission/safety critical, why are there emails at all? Why would there be internet access? And, if there isn't, why would you need phishing audits/tests/honeypots? Someone somewhere is being overly paranoid.



                We can try to reduce our risk to zero but the only way to achieve that is to not use a computer.



                All that being said, though, you will always have to deal with silly people so perhaps keep this activity to yourself next time. ;)






                share|improve this answer

























                  2












                  2








                  2







                  Okay, so, technically, you're never 100% safe. Yes, there could be attempted attacks on your text editor/ASCII viewer. Yes, someone could have somehow magically snuck a DLL into your temporary directory in order to mess with MS Notepad delay loading.



                  But in practice, when you receive an HTML file in a phishing email, it's going to contain some malicious JavaScript or more likely redirect you to a website online that tries to persuade you to hand over your credit card details / logins.



                  So, in practice, examining such a file in Notepad++ is a perfectly reasonable way to see what's been sent to you. The reaction of your colleagues seems unfair, unless you are working in a nuclear silo … and if your job is really that mission/safety critical, why are there emails at all? Why would there be internet access? And, if there isn't, why would you need phishing audits/tests/honeypots? Someone somewhere is being overly paranoid.



                  We can try to reduce our risk to zero but the only way to achieve that is to not use a computer.



                  All that being said, though, you will always have to deal with silly people so perhaps keep this activity to yourself next time. ;)






                  share|improve this answer













                  Okay, so, technically, you're never 100% safe. Yes, there could be attempted attacks on your text editor/ASCII viewer. Yes, someone could have somehow magically snuck a DLL into your temporary directory in order to mess with MS Notepad delay loading.



                  But in practice, when you receive an HTML file in a phishing email, it's going to contain some malicious JavaScript or more likely redirect you to a website online that tries to persuade you to hand over your credit card details / logins.



                  So, in practice, examining such a file in Notepad++ is a perfectly reasonable way to see what's been sent to you. The reaction of your colleagues seems unfair, unless you are working in a nuclear silo … and if your job is really that mission/safety critical, why are there emails at all? Why would there be internet access? And, if there isn't, why would you need phishing audits/tests/honeypots? Someone somewhere is being overly paranoid.



                  We can try to reduce our risk to zero but the only way to achieve that is to not use a computer.



                  All that being said, though, you will always have to deal with silly people so perhaps keep this activity to yourself next time. ;)







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 2 hours ago









                  Lightness Races in OrbitLightness Races in Orbit

                  1,71411114




                  1,71411114





















                      1














                      Yes, breaches could occur upon downloading the file and then opening it in Notepad / other basic widely-used text editor, because payloads can be specifically crafted to interact upon such editors as Notepad.



                      Example: Notepad.exe, like many of the Windows programs, uses system libraries. One of those system libraries loads shdocvw.dll (Internet Explorer related component). shdocvw.dll has a delay-load dependency on a library called 'ieshims.dll'.



                      This .dll could be searched in the current directory and loaded from there. So if an attacker would deploy it along with the .txt file, it could use this setup as an exploit to load its .dll and then go from there.



                      The solution to this: use your own text editor/viewer that is not dependent on any Windows components / libraries. Mine is just called Edit.ExE, 100% independent of any external resources and 100% safe regarding processed content (reads everything directly as ASCII / text with no content detection). You don't have one; use a very obscure one no one would bother to exploit.






                      share|improve this answer




















                      • 16





                        "This .dll could be searched in the current directory and loaded from there." So if the only thing that's in the directory of the html file is that html file, then you're not exposed to this attack? Seems like an easier fix than writing your own text viewer.

                        – UKMonkey
                        yesterday






                      • 13





                        "100% independent of any external resources " - so you read the file by direct access to the disk sectors, in case your OS is compromised? And you don't even use the OS to load Edit.ExE, in case it was compromised to recognize that file name as being an obvious name for a file editor? Security is one thing, but paranoia is something else.

                        – alephzero
                        yesterday






                      • 6





                        Are you really advocating for security through obscurity? -1

                        – forest
                        19 hours ago











                      • @alephzero : I think the point is that this email attachment couldn't have compromised his editor before he has opened it, and his editor doesn't rely on other code that is inherently compromised.

                        – Jerry B
                        14 hours ago






                      • 1





                        It's theoretically possible. But it's also possible that you get hacked without doing anything, including downloading the file. If you want to prevent this possibility, it is more practical to write a program to insert an underscore after each character, which would destroy most malicious code, and open it with a familiar editor.

                        – user23013
                        9 hours ago















                      1














                      Yes, breaches could occur upon downloading the file and then opening it in Notepad / other basic widely-used text editor, because payloads can be specifically crafted to interact upon such editors as Notepad.



                      Example: Notepad.exe, like many of the Windows programs, uses system libraries. One of those system libraries loads shdocvw.dll (Internet Explorer related component). shdocvw.dll has a delay-load dependency on a library called 'ieshims.dll'.



                      This .dll could be searched in the current directory and loaded from there. So if an attacker would deploy it along with the .txt file, it could use this setup as an exploit to load its .dll and then go from there.



                      The solution to this: use your own text editor/viewer that is not dependent on any Windows components / libraries. Mine is just called Edit.ExE, 100% independent of any external resources and 100% safe regarding processed content (reads everything directly as ASCII / text with no content detection). You don't have one; use a very obscure one no one would bother to exploit.






                      share|improve this answer




















                      • 16





                        "This .dll could be searched in the current directory and loaded from there." So if the only thing that's in the directory of the html file is that html file, then you're not exposed to this attack? Seems like an easier fix than writing your own text viewer.

                        – UKMonkey
                        yesterday






                      • 13





                        "100% independent of any external resources " - so you read the file by direct access to the disk sectors, in case your OS is compromised? And you don't even use the OS to load Edit.ExE, in case it was compromised to recognize that file name as being an obvious name for a file editor? Security is one thing, but paranoia is something else.

                        – alephzero
                        yesterday






                      • 6





                        Are you really advocating for security through obscurity? -1

                        – forest
                        19 hours ago











                      • @alephzero : I think the point is that this email attachment couldn't have compromised his editor before he has opened it, and his editor doesn't rely on other code that is inherently compromised.

                        – Jerry B
                        14 hours ago






                      • 1





                        It's theoretically possible. But it's also possible that you get hacked without doing anything, including downloading the file. If you want to prevent this possibility, it is more practical to write a program to insert an underscore after each character, which would destroy most malicious code, and open it with a familiar editor.

                        – user23013
                        9 hours ago













                      1












                      1








                      1







                      Yes, breaches could occur upon downloading the file and then opening it in Notepad / other basic widely-used text editor, because payloads can be specifically crafted to interact upon such editors as Notepad.



                      Example: Notepad.exe, like many of the Windows programs, uses system libraries. One of those system libraries loads shdocvw.dll (Internet Explorer related component). shdocvw.dll has a delay-load dependency on a library called 'ieshims.dll'.



                      This .dll could be searched in the current directory and loaded from there. So if an attacker would deploy it along with the .txt file, it could use this setup as an exploit to load its .dll and then go from there.



                      The solution to this: use your own text editor/viewer that is not dependent on any Windows components / libraries. Mine is just called Edit.ExE, 100% independent of any external resources and 100% safe regarding processed content (reads everything directly as ASCII / text with no content detection). You don't have one; use a very obscure one no one would bother to exploit.






                      share|improve this answer















                      Yes, breaches could occur upon downloading the file and then opening it in Notepad / other basic widely-used text editor, because payloads can be specifically crafted to interact upon such editors as Notepad.



                      Example: Notepad.exe, like many of the Windows programs, uses system libraries. One of those system libraries loads shdocvw.dll (Internet Explorer related component). shdocvw.dll has a delay-load dependency on a library called 'ieshims.dll'.



                      This .dll could be searched in the current directory and loaded from there. So if an attacker would deploy it along with the .txt file, it could use this setup as an exploit to load its .dll and then go from there.



                      The solution to this: use your own text editor/viewer that is not dependent on any Windows components / libraries. Mine is just called Edit.ExE, 100% independent of any external resources and 100% safe regarding processed content (reads everything directly as ASCII / text with no content detection). You don't have one; use a very obscure one no one would bother to exploit.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited 19 hours ago









                      Peter Mortensen

                      70649




                      70649










                      answered yesterday









                      OvermindOvermind

                      4,559718




                      4,559718







                      • 16





                        "This .dll could be searched in the current directory and loaded from there." So if the only thing that's in the directory of the html file is that html file, then you're not exposed to this attack? Seems like an easier fix than writing your own text viewer.

                        – UKMonkey
                        yesterday






                      • 13





                        "100% independent of any external resources " - so you read the file by direct access to the disk sectors, in case your OS is compromised? And you don't even use the OS to load Edit.ExE, in case it was compromised to recognize that file name as being an obvious name for a file editor? Security is one thing, but paranoia is something else.

                        – alephzero
                        yesterday






                      • 6





                        Are you really advocating for security through obscurity? -1

                        – forest
                        19 hours ago











                      • @alephzero : I think the point is that this email attachment couldn't have compromised his editor before he has opened it, and his editor doesn't rely on other code that is inherently compromised.

                        – Jerry B
                        14 hours ago






                      • 1





                        It's theoretically possible. But it's also possible that you get hacked without doing anything, including downloading the file. If you want to prevent this possibility, it is more practical to write a program to insert an underscore after each character, which would destroy most malicious code, and open it with a familiar editor.

                        – user23013
                        9 hours ago












                      • 16





                        "This .dll could be searched in the current directory and loaded from there." So if the only thing that's in the directory of the html file is that html file, then you're not exposed to this attack? Seems like an easier fix than writing your own text viewer.

                        – UKMonkey
                        yesterday






                      • 13





                        "100% independent of any external resources " - so you read the file by direct access to the disk sectors, in case your OS is compromised? And you don't even use the OS to load Edit.ExE, in case it was compromised to recognize that file name as being an obvious name for a file editor? Security is one thing, but paranoia is something else.

                        – alephzero
                        yesterday






                      • 6





                        Are you really advocating for security through obscurity? -1

                        – forest
                        19 hours ago











                      • @alephzero : I think the point is that this email attachment couldn't have compromised his editor before he has opened it, and his editor doesn't rely on other code that is inherently compromised.

                        – Jerry B
                        14 hours ago






                      • 1





                        It's theoretically possible. But it's also possible that you get hacked without doing anything, including downloading the file. If you want to prevent this possibility, it is more practical to write a program to insert an underscore after each character, which would destroy most malicious code, and open it with a familiar editor.

                        – user23013
                        9 hours ago







                      16




                      16





                      "This .dll could be searched in the current directory and loaded from there." So if the only thing that's in the directory of the html file is that html file, then you're not exposed to this attack? Seems like an easier fix than writing your own text viewer.

                      – UKMonkey
                      yesterday





                      "This .dll could be searched in the current directory and loaded from there." So if the only thing that's in the directory of the html file is that html file, then you're not exposed to this attack? Seems like an easier fix than writing your own text viewer.

                      – UKMonkey
                      yesterday




                      13




                      13





                      "100% independent of any external resources " - so you read the file by direct access to the disk sectors, in case your OS is compromised? And you don't even use the OS to load Edit.ExE, in case it was compromised to recognize that file name as being an obvious name for a file editor? Security is one thing, but paranoia is something else.

                      – alephzero
                      yesterday





                      "100% independent of any external resources " - so you read the file by direct access to the disk sectors, in case your OS is compromised? And you don't even use the OS to load Edit.ExE, in case it was compromised to recognize that file name as being an obvious name for a file editor? Security is one thing, but paranoia is something else.

                      – alephzero
                      yesterday




                      6




                      6





                      Are you really advocating for security through obscurity? -1

                      – forest
                      19 hours ago





                      Are you really advocating for security through obscurity? -1

                      – forest
                      19 hours ago













                      @alephzero : I think the point is that this email attachment couldn't have compromised his editor before he has opened it, and his editor doesn't rely on other code that is inherently compromised.

                      – Jerry B
                      14 hours ago





                      @alephzero : I think the point is that this email attachment couldn't have compromised his editor before he has opened it, and his editor doesn't rely on other code that is inherently compromised.

                      – Jerry B
                      14 hours ago




                      1




                      1





                      It's theoretically possible. But it's also possible that you get hacked without doing anything, including downloading the file. If you want to prevent this possibility, it is more practical to write a program to insert an underscore after each character, which would destroy most malicious code, and open it with a familiar editor.

                      – user23013
                      9 hours ago





                      It's theoretically possible. But it's also possible that you get hacked without doing anything, including downloading the file. If you want to prevent this possibility, it is more practical to write a program to insert an underscore after each character, which would destroy most malicious code, and open it with a familiar editor.

                      – user23013
                      9 hours ago

















                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Information Security Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsecurity.stackexchange.com%2fquestions%2f206364%2fis-it-ever-safe-to-open-a-suspicious-html-file-e-g-email-attachment%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                      What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                      Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos