1,326 karma · joined Jul 6, 2009 (17y ago) · 248 submissions
comment 13y ago · link · parent
Does it catch everything? Can you stop thinking critically? No, but it's still nice to have.
This sort of goes hand in hand with IDE tools (e.g. "change method name" sorts of things), so I don't think we necessarily disagree.
> I've never seen a bug in production that could have been prevented with static analysis.
That seems unlikely to me.
I do application penetration testing for a living, and I'll often use static analysis tools in my work. (Both robust, established tools and ad hoc scripts.) For example, check out Brakeman for Rails apps. These tools find actual bugs in actual production software.
Do they find everything? No, you can't rely on them completely. But they're still nice to have.
comment 13y ago · link · parent
I'm a big fan of TypeScript's approach, which gives you the best of both worlds. Start with fully dynamic code to explore the problem space, then add more static guarantees as you firm up your design.
I haven't had occasion to write a big web app recently, but I'm itching to find one so I can put TypeScript through its paces.
comment 13y ago · link · parent
Disabling compression is a 100%-effective countermeasure for compression oracle attacks.
> Also, why does the site http://breachattack.com/ says that "Randomizing secrets per request" is less effective than disabling compression?
Putting random data in the server response will only slow down the attack. With enough requests, the noise from that random data will wash out.
Disabling compression will stop the attack cold. The whole thing is predicated on analyzing the size of the compressed text. No compression, no compression oracle.
comment 13y ago · link · parent
The form he's demonstrating is a common misstep in Rails. Instead of writing something like:
current_user.apartments.destroy(params[:id])
The programmer wrote: Apartment.destroy(params[:id])
Meaning that the apartment lookup is not being done within the context of the current user, it's global. This means an attacker can delete other users' apartments with crafted URLs.When I'm testing Rails applications, I always grep the source for something like:
/[A-Z][A-Za-z0-9_]\.(find|destroy|...)/
To find vulnerabilities of exactly this kind.comment 13y ago · link · parent
I don't mean to suggest CoffeeScript is without value. I just don't think it has hit the requisite "escape velocity" to make me want to integrate it to my tool chain.
comment 13y ago · link · parent
This is a mildly insulting, as is the invocation of Blub.
CoffeeScript doesn't have a ton of exotic features. String interpolation, list comprehensions, and class definitions (!) are all familiar to programmers from other languages.
I'm guessing that a lot of people have weighed CoffeeScript's feature set against its overhead and decided the trade just isn't worth it.
comment 13y ago · link · parent
They're broadening that recommendation also to include pages that reflect input. Think GET requests that take query string parameters. So e.g. https://google.com/search?q=pajamas would become https://google.com/search?q=pajamas&csrf=etcetc.
It seems like a pretty impractical mitigation to me. For one thing, it would make it very difficult to share links; a link containing my CSRF token wouldn't work for you. It would also make it much easier to give up your CSRF token. We would need to retrain people to think of the URLs they're viewing as personal and secret.
comment 13y ago · link · parent
I think you're underestimating how common this is.
For example, view source on https://www.google.com/search?q=pajamas and look at how many times "pajamas" appears on the page.
This is a simple example, but query string parameters (and other attacker-controlled data) get reflected in server responses all the time. Eliminating this behavior is not a realistic goal.
comment 13y ago · link · parent
1. User logs in to target web app (e.g. hapless.com).
2. User visits your malicious content (e.g. evil.com).
3. Your page does a BREACH attack, issuing tons of HTTPS GET requests (by creating images in JavaScript, maybe) to hapless.com with query string parameters that manipulate the response.
4. You observe the responses and recover the CSRF token.
5. You attack the user with a standard CSRF attack on evil.com or elsewhere.
Note that this attack requires the user to interact with attacker-controlled content via a MITM'd connection.> I imagine tons of applications do this, but it's nowhere near as far reaching as CRIME.
This is very common in web applications. Echoing query string parameters in the server response is the basis for reflected cross-site scripting, for example. And in a complex web application, tons of pages will have CSRF tokens embedded somewhere.
I do agree that CRIME is a much more dangerous attack.
comment 13y ago · link · parent
I wouldn't say it's easier. Remember that we need to find a single message that generates a collision under both hash functions. So our strategy is to generate a massive number of collisions for the shorter function and hope that there's one pair of messages in there that collide under the longer function.
> What about non-concatenative methods?
I think this will again boil down to finding a single message that generates a collision under both hash functions. It won't matter too much whether you XOR the hashes or concatenate them.
comment 13y ago · link · parent
Merkle-Damgard hash functions look like this:
function MD(M, H, C):
for M[i] in pad(M):
H := C(M[i], H)
return H
For message M, initial state H, and compression function C. In other words, pad the message, break it into blocks, and use the compression function to "mix" each block into the hash function's state. The final state is the result.Antoine Joux showed that for any MD hash function, generating many collisions is not much more difficult than generating one. Here's how:
1. Take the initial state H[0].
2. Find two single-block messages that collide under C with H[0] as the input state. Call the result H[1].
3. Now find another pair of single-block messages that collide under C with H[1] as the input state. Call the result H[2].
4. Iterate as needed.
Here's the trick: each single-block collision you find is actually doubling your set of colliding messages. This is because for each block of the message, you can select either of two candidate blocks. So if the effort required to find a collision in a b-bit hash function is 2^(b/2), the effort to find 2^n such collisions is only n * 2^(b/2).What does this mean for cascaded hash functions? Well, consider a hypothetical construction that simply concatenates a 128-bit hash function with a 160-bit function. A plan of attack might look like this:
1. Find 2^80 colliding messages under the 128-bit function. This should take roughly 80 * 2^64 ~= 2^70.3 units of "effort".
2. Evaluate each message under the 160-bit function. There's probably a collision in there somewhere. This will take around 2^80 work, dwarfing what we did in the first step.
The effort to find a collision under both functions is thus only about what it takes to find a collision under the stronger of the two.Shameless plug: we will have a few problems exploring the consequences of Joux collisions in set seven of the Matasano crypto challenges.
comment 13y ago · link · parent
As you say: persistence is key. We get a lot of emails. If you feel like you've slipped through the cracks, don't hesitate to ping us again!
195.
Applied Cryptography Engineering(sockpuppet.org ↗)
118 points · by sdevlin · 13y ago · 30 comments
comment 13y ago · link · parent
Also, you probably wouldn't look at someone funny for requesting a kleenex. All the things you mentioned have pretty strong brand-name recognition, such that e.g. even non-PowerPoint slide decks are called PowerPoints.
comment 13y ago · link · parent
Quick version: RC4 has biases in the key stream it generates. This means that for a given offset, certain bytes are more likely to appear than others. How do you exploit this? Collect a large sample of the same plaintext encrypted under different key streams. Examine the biases apparent in your samples and compare them to the actual key stream biases. You should be able to infer the actual plaintext byte.
comment 13y ago · link · parent
The key stream is generated independently of the plaintext, so the attacker really only cares that the bytes he's interested in (i.e. session cookies) stay at the same offset in the stream.
comment 13y ago · link · parent
If the traffic is common to everyone, the NSA could just browse to the site.
comment 13y ago · link · parent
It's pretty easy to eyeball your ciphertext and think it's sufficiently garbage-looking, but it's difficult to predict what an attacker can do with access to your running system. Seemingly innocuous flaws can lead to complete plaintext recovery or the ability to forge arbitrary ciphertext. (Here's a fun way to get a taste: http://www.matasano.com/articles/crypto-challenges/)
@cperciva is right that cryptographic security is something that needs to be proven. Since I'm not smart enough to do that, I avoid designing my own crypto systems, and I recommend clients do the same. Lots of risk, little or no reward.
comment 13y ago · link · parent
> Sure, it's complex and you have to get all the details right
What's really dangerous about cryptography (someone on HN pointed this out a few weeks ago) is that you get very little feedback on this. It's very easy to take reliable primitives and build a broken system. When I say "broken" I don't mean "theoretically vulnerable" - I mean "game over".
I get paid to look for these bugs, and they are legion.
> so for developers, I recommend a more modern approach to cryptography — which means studying the theory and designing systems which you can prove are secure.
The average application developer does not have the time or the need to learn the theory at a deep level. And as before, it's very difficult to say with confidence "this design has no bugs".
The best advice I can give developers is to play very conservatively. Our default recommendation is PGP for data at rest and TLS/SSL for data in transit. Or some high-level library like KeyCzar, NaCl, etc.
comment 13y ago · link · parent
We break into banks. And hospitals. And financial firms. And social media startups. And any other business that puts an open port between itself and the big bad world.
Matasano is looking for appsec consultants, now and forever. What does that mean?
We dig deep. Our consultants spend their days sliding up and down the ladder of abstraction, rapidly assimilating unfamiliar systems (and then breaking them). One week you're pulling apart macros in a Lisp app; the next, you're on your hands and knees crawling through x86 disassembly.
We move fast. Our projects run on tight deadlines: one or two weeks is typical. Recently we wrote a bespoke proxy to rip apart a custom encrypted protocol, tamper with messages, and cobble it back together again. That could be a two-week job in itself. At Matasano, that's just Tuesday.
We find bugs. Not just in applications, but in the tools they're built with. That includes some of the biggest open-source and proprietary software stacks in the world.
This is the Mission: Impossible of software gigs, and we need the best people to get the job done. NO PRIOR APPSEC EXPERIENCE REQUIRED. We need great software developers and fast learners, for we intend to go in harm's way. If this sounds interesting to you, we should absolutely talk.
Who knows what evil lurks in the hearts of software applications?
Matasano knows.
Full benefits. Free books. Really smart coworkers. For more information, visit http://www.matasano.com/careers.
Looking for a taste of what we do? Shoot an email to cryptopals@matasano.com. We'll get you started with 48 problems (and counting) of real-world cryptography problems. This is the best answer you will ever get to the question: "Why shouldn't I roll my own crypto?"
comment 13y ago · link · parent
He is correct. (At least, this was true a couple years ago. I haven't used F# since then, but I doubt this has changed.)
I don't have enough F# experience to speak to any potential benefits of this restriction.