David Leadbeater
dgl.cx · Personal blog · on HN since 2008
David Leadbeater writes about security research, including terminal escape sequence bugs, SSH exploits, CVEs, and small networking and SQLite projects.
What HN saysHN links it for terminal security findings, such as Ghostty's title vulnerability, and commenters note that these vulnerability classes recur whenever untrusted data is handled.
26HN people shared it
14linked it in comments
25stories submitted
1.7Kstory points
5 months agolast shared
2008people per year2026
Most-shared posts
- 1SQLite as a Document Database5 people · 244 points · first shared 2020 · 50 comments on HN
- 2Wikipedia over DNS (2008)5 people · 149 points · first shared 2008 · 16 comments on HN
- 3"<ESC>[31M"? ANSI Terminal security in 2023 and finding 10 CVEs5 people · 3 points · first shared 2023 · discussion on HN
- 4Déjà vu: Ghostly CVEs in my terminal title3 people · 208 points · first shared 2024 · 55 comments on HN
- 5Using HAProxy to make SSH and SSL available on the same port3 people · 3 points · first shared 2010 · discussion on HN
- 6Wikipedia over DNS2 people · 69 points · first shared 2010 · 10 comments on HN
- 7Nat-Again: IRC NAT helper flaws (CVE-2022-2663)2 people · 15 points · first shared 2022 · discussion on HN
- 8Bash a newline: Exploiting SSH via ProxyCommand, again (CVE-2025-61984)2 people · 10 points · first shared 2025 · discussion on HN
- 9Blink and you'll miss it – a URL handler surprise2 people · 5 points · first shared 2025 · discussion on HN
- 10Breaking Git with a carriage return and cloning RCE1 people · 373 points · first shared 2025 · 162 comments on HN
- 11Images over DNS1 people · 201 points · first shared 2025 · 50 comments on HN
- 12Can your terminal do emojis? How big?1 people · 178 points · first shared 2025 · 161 comments on HN
- 13Show HN: Wordle over DNS1 people · 170 points · first shared 2022 · 25 comments on HN
- 14Microsoft .NET SDK is violating the GDPR, object now1 people · 37 points · first shared 2020 · 10 comments on HN
- 15Vim blowfish encryption1 people · 36 points · first shared 2014 · 17 comments on HN
What HN people wrote when they linked it
akerl_ · 2025-01-02
Probably worth noting that Ghostty was very recently vulnerable to an old/familiar class of terminal vuln that bit a bunch of older terminal applications a while back: https://dgl.cx/2024/12/ghostty-terminal-title
So moving to a newer / less "bloated" terminal may also just wind the clock back and cause you to encounter a similar sequence of vulns again, like some kind of unfortunate real-world "New Game Plus".
dgl · 2023-12-20
> While good luck doing that on a laptop that is only ever used to establish an SSH session.
[...]
> Set that up about ten months ago now (don't remember exactly). It's working flawlessly. Not a single issue.
So now your laptop hasn't had security updates for 10 months? Things like this are part of the reason I did the research in https://dgl.cx/2023/09/ansi-terminal-security.
It also funny that you've reinvented basically a serial console, but in a modern way, with a second factor. (You could actually just use a physical terminal with S/Key or something.)
> P.S: it's just a proof of concept... But I think that requiring to tap a Yubikey every single time you want to do something as root is something that should be envisaged/discussed more and it was great to read TFA doing it too.
Agreed,
https://neilzone.co.uk/2022/11/using-a-yubikey-or-other-security-key-f… is another potential option for this.
wslh · 2023-11-02
Seems like we live in parallel worlds but I will show you how I am right except you can really proof I am wrong:
At Google, they recommend to go to https://www.google.com/advanced_search so you can write all the keywords you want. In this case I searched for: kvt reverse exploit [1] you can quickly see that google search results are inaccurate and it shows first my HN post because it was very recent. Also the recent article where it is also mentioned and added after I post it here in HN [2] and the following results doesn't end in some correct previous post. I then try again [3] with a more precise search adding kconsole and only found three results without all the keywords while the advanced search says explicitly that all these keywords should be there.
Am I missing something?
[1] https://www.google.com/search?as_q=kvt+reverse+exploit&as_epq=&…
[2] https://dgl.cx/2023/09/ansi-terminal-security
[3] https://www.google.com/search?as_q=kvt+reverse+exploit+kconsole&as…
jayofdoom · 2026-04-18
These categories of vulnerability are not new: https://dgl.cx/2023/09/ansi-terminal-security -- any time you take any untrusted data and do literally anything with it, you're at risk.
busfahrer · 2025-08-10
> One day, on a plane with WiFi before paying, I noticed that DNS queries were still allowed and thought it would be nice to chat with an LLM over it.
There used to be a service where DNS requests to FOO.that-service.org would return the abstract for the Wikipedia article "FOO".
edit: I think it was this one, seems to be defunct now: https://dgl.cx/2008/10/wikipedia-summary-dns
sitkack · 2025-01-02
wmanley · 2022-08-01
You'd compress the JSON, and leave the data that you extract from the JSON uncompressed using Generated Columns[1]. That way you can save the original JSON data, but still have fast querying, etc.
It would look something like this:
CREATE TABLE t1(
json TEXT,
data INT GENERATED ALWAYS AS (json_extract(body, '$.d')) STORED
);
If all you need is fast querying you could make `data` a `VIRTUAL` column and set up an index on it.
You can read more about this kind of technique here: https://dgl.cx/2020/06/sqlite-json-support
[1]: https://www.sqlite.org/gencol.html
kenOfYugen · 2021-06-13
I ended up writing a small wrapper on top of SQLite based on this: https://dgl.cx/2020/06/sqlite-json-support
With proper concurrency control, it can work very well even for multi process applications.
slyall · 2015-01-21
You can also do this with haproxy. I ran it for a while (I think it was for git). Here is a page about how to do it:
https://dgl.cx/2010/01/haproxy-ssh-and-ssl-on-same-port
defaults
timeout connect 5s
timeout client 50s
timeout server 20s
listen ssl :443
tcp-request inspect-delay 2s
acl is_ssl req_ssl_ver 2:3.1
tcp-request content accept if is_ssl
use_backend ssh if !is_ssl
server www-ssl :444
timeout client 2h
backend ssh
mode tcp
server ssh :22
timeout server 2h
btgeekboy · 2014-11-20
Or just use both :) https://dgl.cx/2010/01/haproxy-ssh-and-ssl-on-same-port
jffry · 2014-02-05
Didn't know about Wikipedia-over-DNS, that's pretty cool: https://dgl.cx/wikipedia-dns
pyre · 2012-04-12
Real criminals can:
- Host such data off of a server bought with a stolen credit card and accessed via anonymous proxies.
- Use any of the normal pastebin sides out there with offline encryption methods. (E.g. use PGP + copy/paste encrypted text into browser)
- Host such data off of a hacked server.
I don't really see how ZeroBin is scary. You could even do something like this: https://dgl.cx/wikipedia-dns with a hacked domain account + a hacked server. I'm sure the amount of traffic could be small enough for the hack to remain hidden for a long time.
TacticalCoder · 2023-12-20
> So now your laptop hasn't had security updates for 10 months? Things like this are part of the reason I did the research in https://dgl.cx/2023/09/ansi-terminal-security.
That is very interesting: I'll study that.
You're correct: it's a Debian 12.2 install (seriously hardened). I take it the surface attack is small. I'm literally using only SSH from that machine: it's got a firewall too. It's only allowing new SSH out session to the desktop. Every other traffic is rejected.
So what can realistically affect that machine? SSH exploits for sure...
So for example for the recent SSH "terraspin" exploit, I did implement the workaround (by removing broken Ciphers and MACs from the list of authorized ones).
I don't know about the rest: I mainly SSH as root into the desktop when I need to install a new package and that's about it.
I'm not losing too much sleep over that machine that is on a private LAN and which is not directly connected to the Internet (I'm running both 192.168.x.x and 10.x.x.x at home).
I'm not saying it's a panacea: it was mostly a proof of concept and as it's working fine for my usecase, I kept using it.
vicspace · 2023-08-08
Interesting project! I have lately been trying out these cool and perhaps in some way similar sqlite libraries:
- https://github.com/haxtra/kvstore-sqlite (Basic key-value store for SQLite databases.)
- https://github.com/haxtra/super-sqlite3 (Fast SQLite library with optional full db encryption, simple query builder, and a host of utility features, all in one neat package.)
- https://github.com/haxtra/live-object (Standard javascript object with built-in JSON serialization to file. Dreams do come true sometimes.)
All from github user: https://github.com/haxtra
I think the super-sqlite3 source might also be an inspiration for the 'driver' topic: "super-sqlite3 is a thin wrapper around better-sqlite3-multiple-ciphers, which extends better-sqlite3 (the fastest SQLite library for node.js) with full database encryption using SQLite3MultipleCiphers. super-sqlite3 then adds its own query builder and other convenience features."
And do check out this user's XRay (JavaScript object browser component) library for your preferred component framework.
In my bookmarks I also found these other related and interesting links:
- https://dgl.cx/2020/06/sqlite-json-support (An article about SQLite as a document database, using the relatively new 'genrated columns' feature of sqlite 3.31.0, which you seem to be using)
- https://www.npmjs.com/package/best.db (easy and quick storage)
- https://tinybase.org (This project seems to be an even more similar idea to Doculite)…