Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    T

    thejh

    thejh.net · Personal blog · on HN since 2013

    thejh is a security-minded developer who writes short technical notes on terminal paste attacks, OpenSSH bugs, and other small hacks.

    Visit blogHN submissions
    SecurityOpen Source & Linux
    What HN says

    HN cites its page on copy-pasting from websites into terminals as the standard explanation of that attack, and discusses it in relation to curl|bash trust.

    Stats for nerds
    62HN people shared it
    14linked in comments
    1.6Kstory points
    Apr 2026last shared
    2013people per year2026

    Top posts on HN

    1. 1
      Don't Copy-Paste from Website to Terminal
      56 people · 1.4K points · first shared 2013 · 258 comments on HN
    2. 2
      Want to use my wifi? (2013)
      4 people · 222 points · first shared 2013 · 63 comments on HN
    3. 3
      Reduce bandwidth usage of PNG transfers over HTTP with this one weird trick
      1 person · 3 points · first shared 2021 · Discussion on HN
    4. 4
      OpenSSH 6.8 X11 Security bug
      1 person · 2 points · first shared 2015 · Discussion on HN
    5. 5
      Unicode Underliner
      1 person · 2 points · first shared 2013 · Discussion on HN
    6. 6
      Homepage
      1 person · first shared 2018

    What HN people wrote when they linked it

    • betterunixAug 2013

      It is not really security theater if you consider all the other systems they have in place: the clearance process, auditing, etc.

      What I see is a use of RBAC that is not all that stupid, and that I happen to use on my own systems. RBAC is being used not to guard against abuse but to guard against mistakes. I use the SELinux sandbox to run my web browser, because it is easy to make a mistake like this:

      http://thejh.net/misc/website-terminal-copy-paste

      Ah, not so fast, the sandbox keeps that mistake from spreading all over my home directory. Now, the NSA has people who deal with important national security matters (or whatever), but they might make mistakes too. So the NSA uses RBAC to ensure that an analyst cannot accidentally copy and paste some intelligence secrets into a document that will be sent to people without clearance. Remember that the NSA does not just hire random people off the street; there is some amount of filtering meant to reduce the number of insider threats, but that process alone does not necessarily protect against honest mistakes (hence RBAC).

      It may also be the case that the NSA is not trying to guard against abuses by sysadmins, but by the tens of thousands of non-sysadmins they employ. In theory this is silly because it just means that your enemies will try to get their agents to work as sysadmins, but in practice it is likely to be a cost-effective solution that greatly reduces the number of people you need to worry about.

      Finally there…

    • e12eSep 2015

      One thing not addressed is that copy-pasting from the browser is insecure too:

      http://thejh.net/misc/website-terminal-copy-paste

      But this should be mitigated by TLS/finding a "trusted" source. A bigger issue might be that curl|bash effectively elevates trust in the developer, the CA, the hosting provider to the same level as trust in your distribution's security team.

      And while using SSL, wrapping the script in a function, practising safe posix shell, working acrosss many platforms is good - is it better than using something like https://0install.net ?

      I can understand not wanting to work with dozens of distributions; but if you don' tautomate tests across all of those - does your fantastic script really work?

      [Ed: it's also much easier to secure an off-line signing key than a TLS key that must be always on-line]

    • jolmgOct 2020

      A few terminals, despite having Bracketed Paste Mode, are vulnerable to escape injection. That's when the end-paste escape sequence is included in the paste content, and the terminal lets it pass through, causing the shell to think the paste ended.

      Urxvt is one such terminal with that vulnerability, but it can be fixed with a small perl extension, like the one I provided here:

      https://security.stackexchange.com/questions/39118/how-can-i-protect-myself-from-this-kind-of-clipboard-abuse/184112#184112

      That answer also includes a table checking other terminals for that vulnerability.

      The second example on the following page can be used to test a terminal for that variation of the attack:

      https://thejh.net/misc/website-terminal-copy-paste

    • jwilkJul 2018

      This is bizarre. Why not just give users link to the source?

      https://sorting.cr.yp.to/djbsort-20180710.tar.gz

      And it's certainly not about good security practices:

      * The page teaches users to paste stuff copied from web into a terminal, whereas many terminals are still vulnerable to this: https://thejh.net/misc/website-terminal-copy-paste

      * The page teaches users to use su to lower privileges, whereas many (most?) su implementations are vulnerable to tty hijacking.

    • y7May 2016

      Even if browsers didn't allow changing the clipboard, there's still this older problem: http://thejh.net/misc/website-terminal-copy-paste

      The solution is definitely to avoid pasting commands with newlines in them into your terminal. With Vim, you can use the + register to paste (e.g. "+p). Using iTerm on OS X, I've added a custom keymap for Cmd+V, bound to Run coprocess:

      pbpaste | tr -d "\n"

      which filters out the newlines.

    • larryboltNov 2013

      I'm curious if we ever will see the most popular JS/CSS frameworks/libraries integrated into the browser itself, and a simple attribute in the tag would allow loading the internal version, but still allow failover to the hosted one.

      This could even prevent man-in-the-middle attacks on scripts that otherwise would never expire anyway like described here:
      http://thejh.net/written-stuff/want-to-use-my-wifi

    Related

    Lone Sysadminlonesysadmin.net15 people

    SSH Escape Sequences

    Lone Sysadmin
    Personal · last shared 2025
    Kevin Boonekevinboone.me25 people

    The privacy nightmare of browser fingerprinting

    Kevin Boone
    Personal · last shared 2026
    freeCodeCampmedium.freecodecamp.org582 people

    A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

    freeCodeCamp
    Publication · last shared 2025
    Mattobox.matto.nl15 people

    We Must Revive Gopherspace (2017)

    Matto
    Personal · last shared 2025
    OpenBSD Journalundeadly.org253 people

    OpenSSH: client bug CVE-2016-0777

    OpenBSD Journal
    Publication · last shared 2026
    Oils Blogoils.pub18 people

    Comments on Shared Unix Hosting vs. the Cloud

    Oils Blog
    Company · last shared 2026
    I Don't Play Dartsidontplaydarts.com81 people

    Detecting the use of "curl | bash" server-side

    I Don't Play Darts
    Personal · last shared 2024
    Scott Helmescotthelme.co.uk160 people

    Another free CA as an alternative to Let's Encrypt

    Scott Helme
    Personal · last shared 2026