867 karma · joined April 30, 2013
https://mattslifebytes.com sullivan.matt@gmail.com
Staff Security Engineer at $EMPLOYER_NAME
For web apps, we simply front using an OAuth2-aware proxy. Back in the day, we used this: https://mattslifebytes.com/2018/08/07/protecting-internal-ap... Now, we utilize Kubernetes for hosting most production internal apps, so we run the oauth2-proxy Helm chart (https://github.com/helm/charts/tree/master/stable/oauth2-pro...) to handle verification of identity before sending traffic back to its destination service. Conceptually similar, as auth has to be completed before the request is sent to the back-end.
Some highlights include authorization to attempt entry by tail gating, lock picking, place devices once access has been gained, etc. It's a total vindication for Coalfire (IMO).
A made-up example: assuming Brexit occurs, EU customers of a London-based SaaS chat service may no longer wish to keep that data outside of the EU. The easiest way to wipe it out quickly? Pull the key. Or perhaps your government is trying to compel you to produce data that you believe they have no right to. Some companies would rather have the option to destroy it and face the consequences, whatever they may be.
Up until two years ago, that page used to recommend a minimum browser of either IE 5 or Netscape Navigator 3. If you look at the source and use of 'htm' extension, all signals point towards it being created using an extremely old version of Microsoft FrontPage (2000?). And that's not particularly uncommon on the government systems for unsexy tasks like filing regulatory reports. Limited IT staff and budget, paired with an unimaginable amount of red tape, lead to this type of breach. Also good InfoSec talent usually doesn't stay at the Federal space long. Anyone with strong skills within 50mi of the beltway can make $25k+ more per year by going private sector. Finally, let's not forget a much more limited talent pool is available because, in many situations, these jobs require you to be a U.S. citizen.
I would argue that the SEC breach is only a symptom of a much more systemic problem with IT at the Federal level. To fix it will be extremely costly and painful. To do nothing will be extremely costly and painful.
The key is absolutely does not contain enough entropy, because your key material is only comprised of the ascii-printable hex chars converted into a byte value. So instead of a byte having 256 different possibilities, a byte now will only be one of 16 values. Bruteforcing these keys would be incredibly trivial. To decode the hex into actually random key material, you would have needed to do something like hexToBytes("5827800f46cef978"), which would yield a correctly random byte array of [88, 39, 128, 15, 70, 206, 249, 120]. Note that this is half the proper key size required for AES-128.
I also want to echo the concerns already voiced by others in saying that key material needs to be generated from a strong random provider, and not just from the hash of the file.
I say this in the interest of privacy of those who might use your service, so please don't take any offense: please disable the encryption feature entirely until you can get assistance from someone with extensive experience in implementing crypto, because as it exists now, the implementation is fatally flawed.
It wouldn't be illegal, but I think you'll have serious issues with viability. Concern #1 would be when / where / why you would distribute my encryption keys. For example, I am a SaaS, perhaps small, perhaps big. You are a one-or-two person startup holding my encryption keys, and the FBI comes knocking with an NSL. You will not have the money / resources to fight it, so you'll turn over those keys without telling me (as you are required to by law). However maybe it was a BS request, and maybe had I known about it I could have fought it with my A+ legal team.
The other issue is one of data mutability. If you are just storing files, there is some merit in separate key storage. However, if your SaaS does something with that data (converts it, processes it, moves it), then those encryption keys will be right back in the hands of the company doing the data holding.
Finally, there are very few companies that care enough about encryption to actually do it, and those who care that much about it probably won't be willing to ship that functionality out of the company.
(A bit about me: I am a webapp security / crypto guy at a mid-sized SaaS company)
For the extension itself: I like that it doesn't call out for information unless called upon, but if I ask for information about a site, I see no reason for you to have to collect the full URL and POST it to /track. That could lead to unexpected data leakage (as some URLs could be sensitive). You should probably get those API calls over to using HTTPS as well.
Also with every lookup, my console gets the log message "asdf", which is kind of weird. One thing I noticed is that the extension is pretty slow to get information. It appears it calls out for each item individually, and this leads to seven unique calls to your API that could be condensed into one request / response. If an API call fails with a 500 error, the entire stacktrace is dumped to the user. You'll want to disable debugging mode in your Express app to ensure that doesn't happen.
Since these APIs are public, you might want to consider rate limiting by IP, or you might find that your extension isn't the only consumer of them. A free and open WHOIS or Geolocation API that responds with JSON could be abused by other app developers, and having that already around moves the cost from them to you.
(I'm not affiliated with them in any way)
(but of course courts have sent people to jail for much less...)
E-mail is sent via the SMTP protocol, a protocol that made perfect sense in 1982. Since then, changes have been hacked together and the protocol has been bastardized beyond recognition to achieve various goals.
For example, if you want to transmit messages via an encrypted channel, you'll use the STARTTLS mode (tacked onto the protocol in the mid 2000s). But even if you are using STARTTLS, the server is likely not actually validating the certificate, as very few really do (even Google Apps / Gmail doesn't seem to check, as far as I can tell). So a MITM attacker could just set up their system to answer with a self-signed certificate, and there's a very high chance the client sending the message is going to go ahead anyway, even if it can't verify that the server it's talking to is the real SMTP server for example.com
Additionally, we've had a serious problem verifying that the sender of an e-mail is legitimate. In 2006 SPF (Sender Policy Framework) was proposed, which allows a domain to declare what IP addresses can send mail from it. However using SPF breaks things (like Gmail's ability to allow you to send from another non-Gmail account, for example) and almost nobody uses hard-fail mode to reject mail based on SPF. In 2011 DKIM (DomainKeys Identified Mail) was officially standardized, and this security add-on allows the message to contain an RSA-signed header vouching that the "real" example.com generated the message. DKIM is a really big step for e-mail authentication, and is really starting to see wide adoption. However, many mail providers don't check for the DKIM header on receipt, thus leaving their users susceptible.
Other grossness includes the actual message transmission schemes - using multipart messages with base64-encoded attachments, all encoded (typically) in the quoted-printable encoding. Again a great method for the late 80s, but completely, totally, 100% inappropriate for modern communications. Base64 encoding an attachment also causes the attachment to grow by roughly 33%. Client software has to be incredibly complex to deal with all of the bastardized, non-spec implementations of message boundaries, character encodings, etc. The standards are there, but are complicated and ripe for accidental or intentional abuse. And, finally, messages have to be pretty grossly constructed to support unicode (this is an example UTF-8 subject line: =?utf-8?B?Hello!?= ).
The entire protocol needs a ground-up re-write. In my opinion, a lot (perhaps all) could even be borrowed from HTTPS. Imagine just sending e-mail by using a REST API, authenticated by utilizing client-side certificates. But that's probably just a pipe dream :)