Top
Best
New

Posted by shmulc 1 hour ago

Claude Code's "Don't Ask Again" exposes passwords in 1,122 public GitHub files(apiiro.com)
47 points | 36 comments
bcherny 59 minutes ago|
Boris from the Claude Code team here. Historically Claude Code has not done secret scrubbing (there are many good tools for that), but we are looking into what we can do to prevent this.

That said, a few thoughts:

1. .claude/settings.local.json is meant to stay local. This is not a file you should check into source control. We automatically gitignore it when Claude creates the file, so in this case the files were manually created and checked in (docs: https://code.claude.com/docs/en/settings)

2. Permission rules are old hat. Everyone should be using auto mode instead. It is safer and also does not require manually maintaining finicky allow/deny lists. Auto mode is enabled by default and is included for free in all plans.

3. Regardless of what agent you use, you should have secret scanning enabled. GitHub and other source control hosts offer it. There are many threat models that it protects against and you should absolutely use it if you can. (see https://github.com/security/plans)

markasoftware 51 minutes ago||
Auto mode cannot be considered safer than anything because it does not even attempt to guarantee any sort of security. The threat model is not even defined. It cannot be quantified or compared with any other approach other than "full access"
bcherny 44 minutes ago||
Auto mode is significantly safer than manual approval in practice. Details about the engineering approach and how we tested whether it is safer here: https://claude.com/resources/articles/auto-mode-default-in-c....
cozzyd 5 minutes ago|||
I run CC as its own user on my laptop with no secrets/keys/erc available other than through a LPE exploit or perhaps installing a keylogger. Can I guarantee CC won't attempt any of those things in auto mode?
ceejayoz 22 minutes ago|||
Is that because auto mode is good, or because the manual approval system sucks?
gsnedders 3 minutes ago|||
Indeed. The article only compares the status quo manual system versus the auto system — and doesn’t consider ways that the manual could be improved.

As it says:

> 5% allow any shell command outright, and another 43% have interpreter rules like Bash(python:*) or Bash(node:*) that are essentially equivalent in practice

Claude Code never should have prompted to always allow Bash(python:*) or Bash(node:*) — that’s clearly a bad idea, and Anthropic know that (given the references in the article!).

Of course, Bash(python a.py) still isn’t safe if you also allow Write(a.py), because you may as well allow Bash(python:*) at that point, and that’s often practically what people want (“I want to both make edits to the source and then run the test suite”). So maybe the whole permission system is broken to start with — and the actual answer is leaning more heavily on fine-grained sandboxing.

You also, as the article rightfully points out, run into permission fatigue and users blindly hitting allow.

I do still wish you could do more with hooks — outside of auto, I might want to allow a given command via a hook if Claude Code has read access to given file, but there’s no way to query if a given path allows/denies read/write.

bcherny 13 minutes ago|||
The blog post has more detail, but tldr is humans make mistakes that automation can catch.
80fj0348i 29 minutes ago|||
I and other colleagues have been struggling with auto mode refusing perfectly safe commands in our environment, so we frequently find ourselves switching to the other modes to handhold Claude Code into perfectly safe things like triggering deterministic and guardrailed CI/CD pipelines or read-only queries of production data. Auto mode seems overtuned for caution around deployment and production, which is a regression from how useful Claude Code was for operations around June/July. Until that's improved, permission rules are incredibly important to our workflows.
bcherny 16 minutes ago||
Yeah, by default we err on the side of caution. That said, the auto mode classifier is fully customizable based on your team’s usage. Two ways to tune it:

1. After a command is blocked, run /permissions to retry and allow it going forward

2. More deeply configure the classifier itself: https://code.claude.com/docs/en/auto-mode-config

We are working on making these easier and more automated.

written-beyond 8 minutes ago||
Auto mode really easily gaslights itself when it runs into a roadblock and starts deviating so far away from its intended goal that I don't let automode run without me reading what it's actually trying.

I frequently hit stop on and auto mode task to prevent it from completely flooding my context with some completely unrelated garbage.

Claude really should push away tasks that end up needing more exploration in worker contexts. That way the workers can maintain a sensible amount of context without pushing the main chat into the dumb region.

agentdev001 53 minutes ago|||
I appreciate you getting communication out in front of this fast.

> "but we are looking into what we can do to prevent this"

I would presume that CC's auto-review of tool-call turns would already solve this >99% of the time, no? From my read, any harness-side deterministic solution here would be saving the user from themselves, which seems like a bad pattern. Somewhat dulling the scalpel in my mind.

bcherny 51 minutes ago||
There’s a few possible approaches: making sure auto mode catches this, building in basic secret scanning, a few other ideas. Going to prototype a few of these to understand the tradeoffs better before we ship something.
agentdev001 21 minutes ago||
I'm not a CC user myself, so I can't say that I have my head wrapped around exactly how the "yes + don't ask again" flow works. That said- from my (outsider) perspective, saving off the entire tool call [1] and its arguments is very weird. I would expect that the hit-rate following that for similar calls would be very small, which leads me to believe that the list either must be seeded into the auto-reviewer's context, or used in some other similarity-check engine for future calls.

If we've already crossed the bridge to being confident in a non-deterministic reviewer for auto-mode, then, I see no obvious reason as to why we couldn't have the proposed rules be generated by a model. If that were reality, then- all rules placed in settings.local could be secretless, with the confidence of whatever model we tell 'make sure the rule does not contain secret material, consider its destination as potentially public'.

[1] https://code.claude.com/docs/en/permissions#wildcard-pattern... AFAICT, CC will either save off a prefix+wildcard rule, or exact command. Sounds like the former is likely not the cause of the problem here.

bluebands 48 minutes ago|||
This still presumably happens in auto mode as it asks for sensitive commands (and the default is "always allow," which saves it)
bcherny 43 minutes ago||
Yeah good catch. Thinking through what we can do to improve this (ideas welcome).
80fj0348i 27 minutes ago||
I would love if Auto Mode, instead of instantly denying the command, had an option to go into an "assisted manual review" interface where the command was explained in depth (perhaps by an adversarial review agent) and the user asked for their input on whether this command is OK. Perhaps needing a detailed response instead of a simple Yes/No, e.g. so the agent understands if there are compensating controls for the risk.
deadbunny 21 minutes ago|||
This must be satire.

1. We store any of your secrets we find in plaintext please don't commit them with `git add -A`, don't worry Claude will do this for you.

2. Just let us run arbitrary commands on your laptop, it's totally safe (for us)

3. Fuck you, it's not our problem

mococa 47 minutes ago|||
[flagged]
dang 30 minutes ago||
Please make your substantive points thoughtfully and don't cross into name-calling and haranguing.

When knowledgeable people show up to address concerns on HN, that's good for all of us. We don't need you to like or agree with what they say, but we do need you to follow HN's guidelines.

Threads like this can easily turn into mob dynamics—it has happened before—and when they do, that's bad for all of us.

https://news.ycombinator.com/newsguidelines.html

vsri 40 minutes ago||
[flagged]
Aurornis 1 hour ago||
Confusing headline. They scanned for repos where people had committed their .claude/ folder and local settings and then scanned those files for commands which contained keys or passwords.

So pressing “Don’t Ask Again” by itself doesn’t expose passwords by itself. If you commit your local Claude settings and in those settings you have manually approved commands containing secrets directly in the command and then you publish the repo, that’s exposed.

shmulc 1 hour ago||
That's the chain, yes. The part people don't expect: the file is created inside the project, and Claude Code only adds it to your global git ignore, not the repo's .gitignore. So a fresh clone or a second machine commits it like any other file. In 539 of the 1,105 repos we traced, a commit co-authored by Claude itself changed the file.
cassianoleal 17 minutes ago||
It's a disgrace that the parent comment was flagged. My vouching has undone that but it's likely to be flagged again.
Aurornis 11 minutes ago||
All of their comments were auto flagged from the moment they were posted. Must have triggered an LLM detector or spam detector.
binarymax 17 minutes ago||
I keep all my creds in a password manager (1Password in my case) and Claude can’t see them - when a cred is needed it runs a script that calls the op CLI and I tap my fingerprint for access. Sometimes I need to do it a bunch of times for complex operations, but it’s worth it.
lacoolj 1 hour ago||
This page is like 80% repeating itself

If you post output from AI, please remember to edit before publishing

nicce 26 minutes ago||
If the thing is not worth writing by yourself, then it is probably not worth of reading by any humans.
NooneAtAll5 1 hour ago||
don't edit Ai garbage - make Ai your editor that points out mistakes instead
qezz 1 hour ago||

  > Is it public? 
  > 
  > Search your GitHub organization for .claude/settings.local.json and .claude/settings.json. Each hit is a file anyone can read right now.
So, it's not necessarily "public", it's simply in the repository, and whether it's actually public or not depends on the repository settings.

Or am I missing something

mschuster91 17 minutes ago||
> So, it's not necessarily "public", it's simply in the repository, and whether it's actually public or not depends on the repository settings.

Even then, you might not want every developer in your company to have the password to the production SQL database...

shmulc 1 hour ago||
Thanks, fair point. Our 1,122 files are all in public repos. In a private repo, only people with access can read it, but "don't ask again" still writes the password into a project file that gets committed, so it spreads with every clone and fork, and goes public if the repo does.
GaryBluto 1 minute ago||
People chose to upload a file containing their password and make it publicly accessible, I don't see a problem here.
GeoAtreides 59 minutes ago||
"git add . " considered harmful
flufluflufluffy 55 minutes ago||
This just in checking your secrets into source control exposes your secrets!
jedisct1 1 hour ago||
If you really need to commit private files to GitHub, use Turbocrypt https://github.com/jedisct1/turbocrypt/blob/main/docs/git.md
rvz 1 hour ago|
Vibe coders in open source proudly don't read the (slop)code and place all their agents in autonomous loops without them knowing that Claude leaked their passwords and environment variables on GitHub.

This incident would have been caught in an open source harness. This one is closed source malware, and you don't know what Claude Code does internally to behave like this.

Yet another reason why you cannot trust a closed harness.

happyopossum 58 minutes ago|
That’s ridiculously overblown rhetoric. Claude Code didn’t publish these secrets, the users did by committing their Claude Code settings to public repos.

Same thing could/would happen with an open source harness.