1/14/2025 at 2:48:07 AM
[EDIT: See the response by a Cursor dev below — looks like it was not authorized by them]Sounds to me like Cursor internally has a private NPM registry with those packages. Because of how NPM works, it's quite easy to trick it to fetch the packages from the public registry instead, which could be used by an attacker [0].
Assumably, this Snyk employee either found or suspected that some part of Cursor's build is misconfigured as above, and uploaded those packages as a POC. (Given the package description "for Cursor", I'd think they were hired for this purpose.)
If that's the case, then there's not much to see here. The security researcher couldn't have used a private NPM registry to perform the POC if the point is to demonstrate a misconfiguration which skips the private registry.
.
[0] In particular, many proxies will choose the public over the private registry if the latest package version is higher: https://snyk.io/blog/detect-prevent-dependency-confusion-att...
by n2d4
1/14/2025 at 3:26:53 AM
cursor dev here. reasonable assumptions, but not quite the case. the snyk packages are just the names of our bundled extensions, which we never package nor upload to any registry. (we do it just like how VS Code does it: https://github.com/microsoft/vscode/tree/main/extensions)we did not hire snyk, but we reached out to them after seeing this and they apologized. we did not get any confirmation of what exactly they were trying to do here (but i think your explanation that someone there suspected a dependency confusion vulnerability is plausible. though it's pretty irresponsible imo to do that on public npm and actually sending up the env variables)
by ArVID220u
1/14/2025 at 4:56:33 AM
> "pretty irresponsible"Wouldn't it be more like "pretty illegal"? They could have simply used body: JSON.stringify("worked"), i.e. not sent target machines’ actual environment variables, including keys.
by nomilk
1/14/2025 at 7:56:05 AM
It's an unfortunate incentive structure. If you're doing offensive security research, there's two ways you can go about it: you can report the potential vulnerability without exploiting it, in which case you risk the company coming back to you and saying "thanks but we don't consider this a vulnerability because it's only exploited through misconfiguration and we're too smart for that". Maybe you get some token reward of $50.Or you can exploit it and say here's the PoC, this many people at your company fell for it, and this is some of the valuable data I got, including some tokens you'll have to rotate. This puts you into actual bug bounty territory. Certainly the PR side of things alone will incentivize them to pay you so you don't make too much of a noise about how Cursor leaked a bunch of credentials due to a misconfiguration that surely every good programmer knows about and defends against (like so many vulnerabilities seem so dumb in hindsight).
by reubenmorais
1/14/2025 at 11:45:42 AM
Cursor does not have a bug bounty though, and its hard to see how this constitutes anything other than a direct attack on them, their users, or both. "The incentive structure made me do it" does not justify acting like a criminal.by xmodem
1/14/2025 at 1:22:33 PM
Cursor asks researchers to report vulnerabilities to their GitHub security page.The same incentive to show impact applies even without a paid bounty.
by grajaganDev
1/14/2025 at 1:12:26 PM
> Cursor does not have a bug bountyShouldn't this alone be considered criminal negligence at this point? Cursor isn't some random open source project. It's a company that has funding, and subscriptions. Hell, I pay Cursor for a monthly subscription. Pretty incredible that they have no bounty program.
by px43
1/14/2025 at 1:35:09 PM
The lack of a bug bounty program doesn't prohibit them from rewarding reported vulnerabilities.by britannio
1/14/2025 at 5:19:12 PM
do they though?by taskforcegemini
1/14/2025 at 10:43:18 AM
You can also console.log those credentials as a PoC, and then show that the console.log could trivially be replaced by a fetch().Kind of like a lot of exploit PoCs just "pop a calc" (AKA open the Calculator app), not because opening the calculator is valuable to an attacker, but because if you can open calculator, you can do anything.
by miki123211
1/14/2025 at 1:00:25 PM
The problem there though, is that with PoCs like this, as an attacker you want to have a ping back to your system so that you know the attack has been successful (in this case they probably expected/hoped someone at Cursor to install the package, that's the usual objective in a dependency confusion attack). But what they could have done, is send a less sensitive thing like just the current working directory or current effective user, instead of the whole environment.by objectified
1/14/2025 at 2:50:08 PM
What actually changes though in your scenario? Potential bad actor gets RCE on your dev machines, it doesn't really matter what they sent home, you're rotating keys and doing your due diligence either way.by fkyoureadthedoc
1/14/2025 at 9:14:50 AM
I wonder how viable it would be to find a public key your target owns and use it to encrypt the data you send back. Then you could prove to them that you exfiltrated real data without exposing it to anyone outside the company.Alternatively, you could hash it and say “Look, it’s a sha of your database password hyphen “yougotpwnd””
by mistercow
1/14/2025 at 11:59:56 AM
HTTPS certificates should already have that public key for you, so it should be trivial.by necovek
1/14/2025 at 12:03:16 PM
wouldn't capturing only env names without values be ideal middle ground?look we had access to your Aws tokens, we could take over your account but we didn't steal actual token, we just got proof that we could access it
by Szpadel
1/14/2025 at 5:37:44 PM
Yes I agree names only would have been a better approach here.by reubenmorais
1/14/2025 at 8:27:17 AM
Yeah, I agree the incentive structure is broken for bug bounty hunters. Until the BB platforms themselves create some rules for their customers and researchers, we are gonna continue to have the sh*t show that we do now. The reality is that bug bounty hunters are deploying a significant percentage of the total malicious NPM packages each month.by 6mile
1/14/2025 at 9:42:30 AM
> The reality is that bug bounty hunters are deploying a significant percentage of the total malicious NPM packages each month.I don't actually think that is a bad thing.
The TSA screening at airports would be vastly better if TSA maintained a "red team" that regularly tried smuggling guns (or water bottles or whatever) into airports. The agents would be more attentive if the number of incidents they dealt with was large enough that they could practice more often. The system could improve if it had actual feedback on how accurate and effective it was. And instead of agents overreacting or underreacting they could tune their responses to an appropriate level.
The same applies to supply chain attacks. The REAL ones are rare, dangerous, and performed by experts; having a chance to practice catching them, to assess our detection rates, and to adjust our reactions is healthy.
by mcherm
1/14/2025 at 9:46:55 AM
The TSA screening at airports would be vastly better if TSA maintained a "red team" that regularly tried smuggling gunsThey actually do have this. TSA seem to still suck at their job:
https://www.forbes.com/sites/michaelgoldstein/2017/11/09/tsa...
by dagw
1/14/2025 at 4:47:57 PM
You'd also suck if you knew your job is useless busywork.by LtWorf
1/14/2025 at 4:02:59 PM
a prerequisite of “offensive security research” is that it is solicited, no ifs or buts.what they did was absolutely wrong and frankly likely illegal
by whimsicalism
1/14/2025 at 9:14:31 AM
Yeah, it sucks, but that's the way it is. It is super common for bug bounty findings to be ignored or downgraded unless you show actual code exec on their machines or dump some of their creds.by peanut-walrus
1/14/2025 at 10:29:02 AM
It may interest you that Guy Podjarny, one of the Snyk founders, now has an AI coding company (https://www.tessl.io/about) that looks like a competitor of yoursby DigitalNoumena
1/14/2025 at 4:37:37 AM
[flagged]by IAmGraydon
1/14/2025 at 5:32:00 AM
It was a thing back in the late 90s. I still do it in casual conversations with friends, less so in professional settings.It's a gen X thing, like using "lol" to mean literal laughter
by not_a_bot_4sho
1/14/2025 at 5:51:21 AM
it's been a thing at least on irc for at least 20 years. i've been used to it for a long time.by johnny22
1/14/2025 at 5:01:55 AM
I like to call it informal case.by dovin
1/14/2025 at 5:42:50 AM
When I grew up online in the 90s, on IRC, AOL/AIM, ICQ and web forums, it was extremely common. Most of the people I know from then still do it, and I still do it with them and in many other places, although for whatever reason I don't do it here. Although it's 50/50 when on their phones now that phones auto-capitalize by default now.by furyofantares
1/14/2025 at 6:37:11 AM
Rules are put in place to be followed, for a reason. Capital letters at the start of the sentence increase readability. People who don't bother with them are being incosiderate towards their readers.by urig
1/14/2025 at 8:09:25 AM
not at allby wahnfrieden
1/14/2025 at 5:33:16 AM
yes but there could be many possible reasons, for instance- it's muuch faster on mobile
- you're aiming to convey litheness to potential target audiences who will know to recognize it as intentional litheness
- you've gotten used to minimizing the amount of keystrokes necessary for communicating things, to the point it's second nature
- you've worked a lot in the past with older nlp systems, where ignoring capitalization was a given for inputs anyhow, and just got used to treating it as syntactic cruft only strictly necessary in more formal settings ;)
by pizza
1/14/2025 at 6:46:53 AM
With the current default mobile keyboards, I'd guess it's slower, not faster.by cjbprime
1/14/2025 at 7:08:16 AM
> it's muuch faster on mobileThis isn’t 1998. Mobile keyboards autocapitalize. You have to go out of your way to avoid capitalization on mobile.
by stouset
1/14/2025 at 6:46:24 AM
I have been thinking of this too. I find it super annoying to read and it looks unprofessional.by Piisamirotta
1/14/2025 at 7:09:06 AM
how does this bother you, what greater meaning does it have?by demarq
1/16/2025 at 12:27:05 AM
I tend to shy away from intentional illiteracy and laziness, both of which this is an example of. Not capitalizing does also affect readability. That said, I was honestly asking because I’ve seen it a few times on HN in the last couple of weeks and was curious if it’s coincidence or an actual trend.by IAmGraydon
1/14/2025 at 4:43:20 AM
It’s a techbro thing.Sama does it too
by Atotalnoob
1/14/2025 at 5:02:35 AM
You're writing in rust-inspired English it seems, omitting the punctuation mark at the end of your second sentence so it gets returned.by benatkin
1/14/2025 at 5:07:31 AM
it's typesafe and efficientby compootr
1/14/2025 at 5:42:49 AM
e. e. cummings, techbro. who knew?by brookst
1/14/2025 at 5:29:44 AM
It’s a low effort flex. As in: you’re unimportant, this is unimportant, and I’m very busy, so I can’t or won’t bother to capitalize. Which is ironic because it’s more effort to not capitalize.by mmaunder
1/14/2025 at 8:10:44 AM
it's many more keypresses, and using modifier keys is generally rsi-proneby wahnfrieden
1/14/2025 at 8:39:44 AM
Without commenting on this subthread (I don't have an opinion), you or anyone else with this concern should look into sticky modifiers (modifiers that apply to the next key press without being held). They were a game changer for me personally as far as managing RSI, as I had a bad habit of tilting my wrist to eg type a capital T.by maxbond
1/17/2025 at 1:06:36 AM
I use thumb keys (Glove80) which helps but I need to give that a try tooby wahnfrieden
1/14/2025 at 3:31:57 AM
[flagged]by syndicatedjelly
1/14/2025 at 4:06:03 AM
Yeah, I strongly disagree with the way it's characterized here.by benatkin
1/14/2025 at 4:17:32 AM
> we reached out to them after seeing this and they apologized.How does this make it sound like they made Snyk apologize?
by TimTheTinker
1/14/2025 at 3:20:24 AM
> If that's the case, then there's not much to see hereThey could have demonstrated the POC without sending data about the installing host, including all your environment variables, upstream. That seems like crossing the line
by arkadiyt
1/14/2025 at 3:30:25 AM
> If that's the case, then there's not much to see here.Allowing someone full access to the contents of your environment (i.e. output of env command) is a big deal to most, I suspect.
by nomilk
1/14/2025 at 4:49:02 PM
If /proc is mounted you can read all of that.by LtWorf
1/14/2025 at 8:16:44 PM
Hey there! I run DevRel & SecRel @ Snyk, we just published a piece to help dispel all the rumors, etc. This provides a lot of in-depth info on the situation: https://snyk.io/blog/snyk-security-labs-testing-update-curso...by rdegges
1/14/2025 at 11:38:49 PM
This response doesn't make a lot of sense.What's the justification for taking all of the environment variables? This post tries to paper over that particular problem. If your goal was to see if you could attack the dependency chain the first steps of user+hostname would have been sufficient to prove your case.
Taking the environment variables is about taking the secrets, and kind of moves this from PoC to opposition supply chain attack. Not to mention it's not only Cursor devs that would be affected by this, it could have (if your plan worked) attacked anyone using the extensions.
It's also a tough buy given the note about the Snyk cofounder moving to compete directly with Cursor (courtesy @tankster): https://techcrunch.com/2024/11/14/tessl-raises-125m-at-at-50...
Assuming truly innocent motivations, you guys still need to give your heads a shake and rethink your approaches here.
by BeefWellington
1/15/2025 at 3:24:27 PM
Frankly I wouldn't be surprised if this was a case of Hanlon's razor. Some "researcher" thought well ENV vars will certainly show us what we want and that's where the conversation ended without thinking a little harder into what else might be in the vars.by bangaladore
1/16/2025 at 4:34:05 PM
That's not really plausible in the modern legislative environment (pun intended), considering your env vars will contain GDPR-controlled data like your username, at the very least. Combined with the IP address it was collected from, they know who you are and where you live.by neonerosion
1/16/2025 at 4:32:47 PM
The few details given in this response don't match up with what happened.Who did the GDPR review before extracting env vars from systems that were not under your control? How did actively extracting potentially private data from the environment not get flagged as Unauthorized Access?
If this "experiment" (which happened to be against a competitor, mind) was reviewed and approved internally, that is a great demonstration of Snyk's approach to (ir)responsible data collection and disclosure.
by neonerosion
1/14/2025 at 7:02:26 AM
Wasn't this supposed to be fixed in NPM? I remember a talk by the researcher behind portswigger (sorry blanking on his name) doing this a while back, with great success (apple,ms,meta, basically all faang were vulnerable at that time).by NitpickLawyer