Live data from Hacker News

Npm security post-mortem

blog.npmjs.org

51–60 of 65 posts

Re: Npm security post-mortem

#51

The 'we fixed it' link points to four new lines including these: .replace(/>/g, '&lt;') .replace(/ I can't really tell without more background and context, but I'm surprised this doesn't turn > into &gt; and < into &lt;. Is this a mistake? The same code's still in the HEAD.

Yeah, that is very weird. Shouldn't it this?

    .replace(/>/g, '&gt;')
    .replace(/

Re: Npm security post-mortem

#52
post #51

The 'we fixed it' link points to four new lines including these: .replace(/>/g, '&lt;') .replace(/ I can't really tell without more background and context, but I'm surprised this doesn't turn > into &gt; and < into &lt;. Is this a mistake? The same code's still in the HEAD.

Yeah, that is very weird. Shouldn't it this? .replace(/>/g, '&gt;') .replace(/

Actually, someone submitted a pull request to fix this 4 hours before my original comment: https://github.com/isaacs/st/pull/37/files

Re: Npm security post-mortem

#53
> * Before they could start, we had a very serious security vulnerability responsibly disclosed by Will Farrington and Charlie Somerville

> * We fixed it on February 17th

the fix scares the shit out of me:

https://github.com/isaacs/st/commit/5a0c1886737a20d78ae00b61...

     Properly escape all relevant html entities
     Avoid problems with files named things like '' and so on.
     
     -      var name = f.replace(/"/g, '&quot;')
     +      var name = f
     +          .replace(/"/g, '&quot;')
     +          .replace(/>/g, '&lt;')
     +          .replace(/

Re: Npm security post-mortem

#54
post #44
post #23

Earlier quoted context omitted.

Thomas could give you better numbers here, but in general, appsec reviews cost as much as getting software development done. (i.e. For a security review worth the paper you print the report on, you're looking at $5k at the lower end if your application is simple or if someone wants to really do you a favor, and they get substantially more expensive than that. You can get someone to run an automated scan for $500 and…

A $4k billable week is incredibly cheap, so much so that I'd worry about the team delivering it. Our rates are high because big firms bid them up. Why are the cheap teams turning down free money? If someone offers you a $4k week, make sure they know they're cutting you a deal.

> Why are the cheap teams turning down free money?

Hi, i double that. Also I understood your advice better now. Undercharging = making it worse for everyone (consultant profit, work quality, dumping).

Re: Npm security post-mortem

#55

can anybody disclose some figures on how much ^lift (or competitors) costs, e.g.: for a 100K-line Python codebase? A rough ballpark would help a lot.

I used to work as security consultant for a while and final cost depends on how thoroughly you want to go. There's never "i'm done" state. There's always something left to check.

1) app-agnostic bugs, such as XSS/CSRF and other blatant issues

2) app-specific bugs such as access bypass, goto-fails, other obvious bugs like eval(params[:serialized]), security measures switched off, mass assignment :)

3) complex bug chains. Usually I end up with account hijacking or similar severity bugs by chaining few of unrelated and barely exploitable bugs, such as redirects, cookie encodings etc. This requires at least a week (which is $12k if you work with me).

4) infinity. Checking some unpopular ruby gems project uses. Checking popular ones. Checking rails codebase to be sure methods don't have "magic" arguments. Nobody goes that far usually, because attackers will have to do 2-4x more work to get same bugs you may find.

TL;DR, for quick & budget auditing a website like npm $3,200 and one day of work is enough, for any medium sized website people should take 1+ week.

Re: Npm security post-mortem

#56
One of the things I love about Isaac is his empathy. Reading his blog posts, listening to his podcasts on Nodeup, looks like he is writing/talking to me, and since I'm a developer, this makes a huge difference in my motivation.

Great job guys and very responsible choices.

Re: Npm security post-mortem

#57
post #54
post #44

Earlier quoted context omitted.

A $4k billable week is incredibly cheap, so much so that I'd worry about the team delivering it. Our rates are high because big firms bid them up. Why are the cheap teams turning down free money? If someone offers you a $4k week, make sure they know they're cutting you a deal.

> Why are the cheap teams turning down free money? Hi, i double that. Also I understood your advice better now. Undercharging = making it worse for everyone (consultant profit, work quality, dumping).

Hey, just to be clear: I don't think it's wrong to charge less than the market rate, and while I'm more likely to do a project gratis than at 1/2 or 1/3 my rate, we've given people breaks before.

Re: Npm security post-mortem

#58
post #53

> * Before they could start, we had a very serious security vulnerability responsibly disclosed by Will Farrington and Charlie Somerville > * We fixed it on February 17th the fix scares the shit out of me: https://github.com/isaacs/st/commit/5a0c1886737a20d78ae00b61... Properly escape all relevant html entities Avoid problems with files named things like ' ' and so on. - var name = f.replace(/"/g, '&quot;') + var nam…

Holy. Fucking. Crap.

Jesus tapdancing christ that is seriously scary to see in something that's allegedly "all totally secure now, for really reals". More so the fact that such simple sanitization was missing for so long.

Well, I guess I'll put off learning node a bit longer then.

Re: Npm security post-mortem

#59
post #18

Why do they have to apologize for that? Almost every piece of software has security vulnerabilities. Do people now really believe that there are definitely no security vulnerabilities related to the npm registry? Or any other type of registry, or website or application for that matter? People have completely unrealistic expectations about security. Every time you had a significant amount of new functionality, or even…

There's a difference between, say, the local bank claiming to have a giant safe that's rated TL-30 but it turns out to actually be rated TL-15 while the bank across the street also claims to have a TL-30 rated safe when in actuality it turns out that during installation someone smashed a 4ft by 4ft hole through the safe then covered it over with aluminum foil.

There are the inevitable almost impossible to fully plan for security vulnerabilities (e.g. in code outside your control) and then there are vulnerabilities due to extremely poor process at a fundamental level (like sql and html injection).

Re: Npm security post-mortem

#60
post #3

The world would be a little better if every software company could inform its users of security vulnerabilities and bugs as these guys did.

Most do. Only in the extremely bleeding edge world of boutique tech frameworks and tools does it seem out of the ordinary.
Post reply on HN