frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Mad Bugs: Vim vs. Emacs vs. Claude

https://blog.calif.io/p/mad-bugs-vim-vs-emacs-vs-claude
36•Munksgaard•1h ago

Comments

grimm8080•1h ago
What does RCE mean?
virtue3•1h ago
Remote code execution - aka they can run arbitrary code on the compromised machine via the bug.

Basically the worst possible thing.

snarf_br•1h ago
Remote Code Execution, which this isn't, in both cases.

It is code execution.

chrismorgan•1h ago
RCE stands for Remote Code Execution: being able to trigger arbitrary code execution (ACE) from a remote machine.

This, however, is mislabelled: it’s not remote code execution at all, only local. It would only become RCE if there was some path to remotely triggering Vim to open the attack file, or Emacs the attack repository, or if a normal way of fetching a repository automatically set up and executed the hook.

pjmlp•1h ago
> How do we professional bug hunters make sense of this? This feels like the early 2000s. Back then a kid could hack anything, with SQL Injection. Now with Claude.

Lack of accountability.

With other industries, when people aren't happy with their products, they ask for money back, they sue, they switch to the competition.

There are no EULA that assert removal of customer rights if the product is acquired.

zingar•1h ago
I don’t understand the connection to the post, could you elaborate?
pjmlp•1h ago
Those kinds of bugs exist because no-one is accountable for quality like in other industries, unless it is on high integrity computing, or the cyber security laws that are finally coming into place across several countries.
normie3000•1h ago
I'd be interested to understand what modelines are for, and if this is a class of bug that can be disabled via vim settings. Also, are there editors which could not be affected by this class of bug?
normie3000•1h ago
Struggling to find a source, but apparently modelines are disabled by default in debian and perhaps other common distros.
disfadbish•1h ago
modelines are special lines you can put into files that sets vim options when the file is read by vim. Probably most commonly used to set tab space and tab width.
Roguelazer•1h ago
modelines allow you to put a special comment in your file (typically on the first or last line of the file, and [for vim] of the format `# vim: set ts=2:`) to configure a subset of editor settings automatically whenever that file is opened in a buffer. They're very common, especially in codebases where there are lots of different styles in different files. Many editors (e.g., Zed (as of https://github.com/zed-industries/zed/pull/49267)) support vim and/or emacs's syntaxes for modelines.

Modelines were disabled by default for security reasons for a long time. It's kind of wild to me that they're enabled in some distributions, but there still isn't much restriction on what settings can be configured; I've never seen a modeline in the wild that did anything other than set `filetype`, `fileencoding`, `tabwidth`, `expandtab` (hard tabs vs spaces), and maybe `tabstop` / `softtabstop`.

lloeki•56m ago
> I've never seen a modeline in the wild that did anything other than

Hence the securemodelines plugin

https://www.vim.org/scripts/script.php?script_id=1876

> if this is a class of bug that can be disabled via vim settings.

    set nomodeline
That is, as parent mentioned, if it's not done already by your distro or OS.
eterm•47m ago
They no doubt predate .editorconfig, but the problem as described is now better solved by .editorconfig, which can be used to configure directory and file specific configuration and works cross-editor too.
000ooo000•1h ago
tldr

    /* vim: set showtabpanel=2 tabpanel=%{%autocmd_add([{'event'\:'SafeStateAgain','pattern'\:'*','cmd'\:'!id>/tmp/calif-vim-rce-poc','once'\:1}])%}: */
Andebugulin•1h ago
That's a bit funny to me, because the level of absurdity you get from reading something like that is insane, I have been using vim on a daily bases for more than 5 years now. One day thought about contributing to vim because was silly enough to believe that the tool shouldn't be that many lines of code, something doable, like in couple thousands, then found out its way way more than that and closer to half a mill, couldn't even dream of understanding anything, not close to be fluent enough to find RCEs.
teiferer•23m ago
> shouldn't be that many lines of code, something doable, like in couple thousands

If you believe that then you have hardly scratched the surface of what your editor is capable of doing.

zingar•1h ago
The claim is astonishing, given emacs’ continuous use and open source scrutiny for decades. Edit: and turns out to be a problem with git, not emacs.

OTOH it’s really just the core that has been used so widely and so continuously for so long. This integration with git will have been scrutinized far less.

As an emacs user I frequently find myself in territory where I’m seemingly the only person in the world with my use case. In fact that’s half of the value: I can make emacs do whatever I want. Which means there’s security consistent with a bus factor of 1.

snarf_br•1h ago
Overhyped, misnomer as this is not an RCE, and emacs maintainers who are correct as you can trigger the same thing by just running git ls-files to execute things if you configure the .git folder as the exploit does.
cryptbe•27m ago
Disclosure: I didn’t discover the bugs, but helped write the blog post.

These issues are technically classified as local code execution (AV:L), but they go against a pretty strong user expectation: that opening a file should be safe. In reality, they can be triggered through very common workflows like downloading and opening files, which makes them feel a lot closer to some remote scenarios, even if they’re not strictly RCE.

At the end of the day, regardless of how you classify them, it’s worth being aware of the risks when opening untrusted files in editors like Vim or Emacs.

eesmith•5m ago
I'm pretty sure the lesson is that at the end of the day, it’s worth being aware of the risks of using git, as security issues intrinsic to git can extend to other tools which use git as a component.
i_cannot_hack•1h ago
The first one seems to indeed be a real RCE in vim.

Also including the emacs one as a "found vulnerability" seems really disingenuous. It basically amounts to "emacs will call git status, and git status will call git hooks that can execute arbitrary code".

1. As the Emacs maintainers point out, it is indeed an issue with git, not emacs, and they are completely right to not address the issue.

2. It is something that has been known for decades. That is the reason hooks are never copied when doing git clone, to prevent this scenario (notice that the author uses wget instead of git clone to get around this).

Funnily enough this posts highlights both the strengths and the hazards of using AI, (1) quickly and easily finding real issues that would have taken a human a laborious audit to find (2) quickly and unthinkingly generating plausible sounding but ultimately meaningless vulnerability reports on some clout chasing mission and overwhelming open source maintainers with AI slop.

cryptbe•58m ago
When I wget a tarball, unzip, and emacs a.txt inside, I don't expect that it'd execute arbitrary commands.

I think people should be aware of this risk, especially when it looks like it's not getting fixed.

Disclosure: I didn't find the bugs. I helped wrote the blog post.

chotmat•30m ago
I don't think this is fair, as it will likely also affect any editor with Git integration (or not?)
cryptbe•22m ago
Yes, likely. And git is not going to fix it. So isn't it fair to expect the editor maintainers to do something about it, to protect their users, no?
chotmat•10m ago
Tested with zed and vscode. They don't seem to have the issue. Probably due to "Restricted Access" mode when opening new folder?
i_cannot_hack•6m ago
But you would expect running "git status" or "git ls-files" in the unzipped directory to completely pwn your system? Probably not either.

If you don't trust git, you can remove from your system or configure emacs not to use it. If you are worried about unsuspecting people with both git and emacs getting into trouble when downloading and interacting with untrusted malware from the internet, the correct solution is to add better safeguards in git before executing hooks. But you did not report this to the git project (where even minor research beyond Claude Code would reveal to you that this has already been discussed in the git community).

I suspect that what happened here was that (1) you asked Claude to find RCEs in Emacs (2) Claude, always eager up please, told you that it indeed has found an RCE and conjured up a convincing report with included PoC (3) since Claude told you it had found an RCE "in Emacs" you didn't think critically about it but simply submitted Claude's report to the Emacs project.

Had you instead asked Claude to find RCEs in git itself and it told you about git hooks, you probably would not have turned around and submitted vulnerability reports to all tools and editors that ever call a git command.

lloeki•43m ago
> The first one seems to indeed be a real RCE in vim.

Barely, since there is little restriction as to what options modelines can set they should be largely considered equivalent to eval (if unintentionally). And generally they are which is why distros typically disable them by default.

IMHO in this day and age securemodelines should just be the default.

https://www.vim.org/scripts/script.php?script_id=1876

chrismorgan•1h ago
I suspect that if you asked ten Vim developers where they’d start looking for this kind of security issue, at least nine of them would say “modeline” (and if one didn’t, it would just be because they forgot about the feature, and would change their answer to that as soon as you mentioned it). There’s a reason popular configurations have disabled it from time immemorial.

As for the Emacs thing, it feels utterly unfair to blame Emacs. The issue is 100% Git, and it’s unreasonable and undesirable for things like Emacs to try to put guard rails around parts of its functionality. Especially guard rails that may harm functionality. They were right to decline the suggested patch.

I don’t know how the sessions actually ran, but the Vim one probably started with “low-hanging fruit, let’s start by seeing if modeline has accidentally become insecure yet again”, and the emacs with “meh, don’t know anything offhand, before delving into code let’s see if… ooh look it runs Git, so can we apply the ol’ fsmonitor chestnut there?”

lloeki•1h ago
> We asked Claude to find a bug in Vim. It found an RCE. Just open a file, and you’re owned.

Yeah reading the above opening paragraph I was immediately going "oh Claude found out about modelines"

modelines are largely considered a (roundabout) equivalent to flat out eval, There's a reason plugins such as securemodelines exist:

https://www.vim.org/scripts/script.php?script_id=1876

johnisgood•13m ago
Right. I am surprised to see this considered to be an RCE. Or a "mad bug" worthy of being here on HN. sighs.

Pretty sure a lot of people have spent lots of tokens into finding RCEs in vim and emacs, he is not the first person to do this.

ploxiln•1h ago
Yup, I've had "nomodeline" in my vimrc for years. I used to add the "securemodelines" plugin https://www.vim.org/scripts/script.php?script_id=1876 but just recently removed that too (I think I may have ran into an annoyance after a vim update, and decided I never really use automatic modeline support anyway)
152334H•33m ago
Doubtful commentary misses the obvious: that, had Calif been slightly more responsible in their harness design -- and in particular, their definition of what constitutes a real bug -- it'd be rather unsurprising if Claude correctly dug some up.
kleiba•15m ago
For Emacs, I agree with the maintainer's analysis that this is really a git bug: what happens is that Emacs runs `git ls-files` and that triggers a script execution.

So, the attack vector here is the following: attacker provides a malicious script in a .git directory, packaged for download. If the user unpacks the the package and merely opens a file, Emacs runs `git ls-files` which in turn executes the malicious script.

However, while I agree that this is a flaw in git, and Emacs should rightfully expect that running an "ls" command should be considered harmless, I do not agree with the stance that this should not require an reaction on the part of the Emacs maintainers: Now that you've been made aware of this unfortunate git behavior, I think some steps should be taken to not trigger it. That is, the functionality that runs `git ls-files` should be double checked (do we really need it? can we avoid the malicious side-effects? etc.)

Claude Code Unpacked : A visual guide

https://ccunpacked.dev/
243•autocracy101•2h ago•48 comments

CERN levels up with new superconducting karts

https://home.cern/news/news/engineering/cern-levels-new-superconducting-karts
29•fnands•37m ago•5 comments

Neanderthals survived on a knife's edge for 350k years

https://www.science.org/content/article/neanderthals-survived-knife-s-edge-350-000-years
122•Hooke•6h ago•79 comments

Mad Bugs: Vim vs. Emacs vs. Claude

https://blog.calif.io/p/mad-bugs-vim-vs-emacs-vs-claude
36•Munksgaard•1h ago•33 comments

Show HN: CLI to order groceries via reverse-engineered REWE API (Haskell)

https://github.com/yannick-cw/korb
21•wazHFsRy•2d ago•2 comments

Bring Back MiniDV with This Raspberry Pi FireWire Hat

https://www.jeffgeerling.com/blog/2026/minidv-with-raspberry-pi-firewire-hat/
44•ingve•3d ago•5 comments

TinyLoRA – Learning to Reason in 13 Parameters

https://arxiv.org/abs/2602.04118
158•sorenjan•4d ago•19 comments

Show HN: 1-Bit Bonsai, the First Commercially Viable 1-Bit LLMs

https://prismml.com/
227•PrismML•11h ago•96 comments

A dot a day keeps the clutter away

https://scottlawsonbc.com/post/dot-system
282•scottlawson•10h ago•82 comments

TruffleRuby

https://chrisseaton.com/truffleruby/
114•tosh•3d ago•6 comments

Remembering Magnetic Memories and the Apollo AGC

https://2earth.github.io/website/20260304.html
4•2earth•42m ago•1 comments

MiniStack (replacement for LocalStack)

https://ministack.org/
208•kerblang•11h ago•40 comments

The Claude Code Source Leak: fake tools, frustration regexes, undercover mode

https://alex000kim.com/posts/2026-03-31-claude-code-source-leak/
1131•alex000kim•19h ago•447 comments

Chess in SQL

https://www.dbpro.app/blog/chess-in-pure-sql
31•upmostly•2d ago•9 comments

Digitizing photos from the 1998 Game Boy Camera

https://swiftrocks.com/digitizing-photos-from-the-1998-game-boy-camera
36•rockbruno•2d ago•6 comments

OpenAI closes funding round at an $852B valuation

https://www.cnbc.com/2026/03/31/openai-funding-round-ipo.html
426•surprisetalk•11h ago•370 comments

4D Doom

https://github.com/danieldugas/HYPERHELL
191•chronolitus•4d ago•43 comments

Slop is not necessarily the future

https://www.greptile.com/blog/ai-slopware-future
225•dakshgupta•17h ago•380 comments

Joel Meyerowitz on Photographing Giorgio Morandi's Studio

https://hyperallergic.com/joel-meyerowitz-on-photograpghing-giorgio-morandis-studio/
3•vinhnx•2d ago•0 comments

Open source CAD in the browser (Solvespace)

https://solvespace.com/webver.pl
323•phkahler•19h ago•103 comments

Analyzing Geekbench 6 under Intel's BOT

https://www.geekbench.com/blog/2026/03/analyzing-geekbench-6-under-intels-bot/
22•hajile•4h ago•12 comments

Ordinary Lab Gloves May Have Skewed Microplastic Data

https://nautil.us/ordinary-lab-gloves-may-have-skewed-microplastic-data-1279386
99•WaitWaitWha•10h ago•35 comments

Butterfly-collecting: The history of an insult (2017)

http://lughat.blogspot.com/2017/10/butterfly-collecting-history-of-insult.html
10•jruohonen•2d ago•1 comments

Why the US Navy won't blast the Iranians and 'open' Strait of Hormuz

https://responsiblestatecraft.org/iran-strait-of-hormuz/
282•KoftaBob•22h ago•754 comments

Back to FreeBSD – Part 2 – Jails

https://hypha.pub/back-to-freebsd-part-2
77•vermaden•4d ago•14 comments

Teenage Engineering's PO-32 acoustic modem and synth implementation

https://github.com/ericlewis/libpo32
109•ericlewis•4d ago•24 comments

Cohere Transcribe: Speech Recognition

https://cohere.com/blog/transcribe
188•gmays•15h ago•55 comments

Axios compromised on NPM – Malicious versions drop remote access trojan

https://www.stepsecurity.io/blog/axios-compromised-on-npm-malicious-versions-drop-remote-access-t...
1830•mtud•1d ago•737 comments

Show HN: Postgres extension for BM25 relevance-ranked full-text search

https://github.com/timescale/pg_textsearch
141•tjgreen•15h ago•42 comments

From 300KB to 69KB per Token: How LLM Architectures Solve the KV Cache Problem

https://news.future-shock.ai/the-weight-of-remembering/
118•future-shock-ai•3d ago•9 comments