482 points · by amirmc · 11y ago · 103 comments
Is this exploitable in this bounty? No idea. At least, it's the right kind of vulnerability you need to forge a certificate.
CVE-2014-1568 was this problem in NSS.
[1]: https://github.com/mirleft/ocaml-nocrypto/blob/master/src/rs...
The unpad does RSA unpadding... or am I completely mistaken?
https://github.com/mirleft/ocaml-x509/blob/master/lib/certif...
PKCS1.5 stripping takes away the leading 0x00 0x01 0xff ... 0x00 -- if this prefix is not present, it fails.
The rest goes through the RSA tranform, and is parsed as PKCS1 DigestInfo, an ASN.1 structure. All ASN parsing checks for presence of trailing bytes, on top and in CONSTRUCTED nodes.
The presence of suffix-checking prevents malleability in my mind. Am I missing something?
Mirage, developed in OCaml for the cloud. The part that really interested me: "If a sudden spike in traffic occurs, the web-servers can be configured to create and deploy copies of themselves to service the demand. This auto-scaling happens so quickly that an incoming connection can trigger the creation of new server and the new server can then handle that request before it times out (which is on the order of milliseconds)."
I love this idea so much. There's also OSv which targets the JVM instead of OCamL. It's an open source commercial enterprise. https://github.com/cloudius-systems/osv
http://nymote.org/blog/2013/introducing-nymote/ and http://amirchaudhry.com/brewing-miso-to-serve-nymote/
Also how well does this work with persistent HTTP connections (and TLS handshakes)? i.e. will the browser keep a persistent connection to the jitsu proxy and the actual requests might be served by different VMs?
For the time-being, Jitsu [1] 'just' spawns a unikernel which serves requests, with no apparently latency for the requester. At some point, when the unikernel hasn't done anything for a while, it is culled (which is something of an implementation detail). In principle, we should be able to use this as part of a set of tools to create the hyper-elastic clouds mentioned upthread.
[1] Just in Time Summoning of Unikernels
Capacity demand is handled by resource concurrency thresholds so why would spinning up a new OS (no matter how lightweight) be better than having non-blocking IO threads on a single kernel?
Mirage's philosophy is mainly about reducing attack surface and unnecessary overhead. That it makes the OS so small that you can boot it up in milliseconds is just an added benefit.
I'm not saying MirageOS doesn't sound neat, I'm just not yet convinced it has a general purpose use case.
> "Before you ask: yes, Piñata will talk to itself and you can enjoy watching it do so."
Also, what should I be using to connect using TLS/TCP?
So to get them to talk to each other you could either write a server that listens on 40001 then proxies any incoming connections back to 10000 (that's what nothrabannosir's named pipes + nc example does), or just connect to 10000 and 10002 and pipe the two connections to each other.
e.x. in Node.js:
var net = require("net");
var server = net.connect({ host: 'ownme.ipredator.se', port: 10002 });
var client = net.connect({ host: 'ownme.ipredator.se', port: 10000 });
server.on('data', console.log.bind(console, 'server'));
client.on('data', console.log.bind(console, 'client'));
client.pipe(server).pipe(client);Try this:
$ mkfifo /tmp/tlspipe
$ nc -l -p 40001 </tmp/tlspipe | tee /tmp/tlsconvo | nc ownme.ipredator.se 10000 > /tmp/tlspipe
Then visit http://ownme.ipredator.se:10001 from that same host (curl or firefox or whatever). Now look at /tmp/tlspipe.Disclaimer: I'm completely unfamiliar with named pipes or tls, but I think this is what they mean.
EDIT: This should also work:
$ mkfifo /tmp/tlspipe
$ nc ownme.ipredator.se 10002 </tmp/tlspipe | tee /tmp/tlsconvo2 | nc ownme.ipredator.se 10000 >/tmp/tlspipe
EDIT2: Just realized that the above only captures one part of the convo. Try this: $ nc ownme.ipredator.se 10002 </tmp/tlspipe | tee /tmp/client-to-server | nc ownme.ipredator.se 10000 | tee /tmp/server-to-client >/tmp/tlspipe
Now you have the full back and forth. E.g.: $ strings /tmp/server-to-client
sYcdI*
Cambridge1
BTC Pinata Team1 0
ocaml-tls@h3q.com0
150207183718Z
150329183718Z0$1
tls services0
...http://www.felipemartins.info/2013/03/netcat-the-it-swiss-kn...
FWIW you can also do it with a single socat invocation, but I'll leave the exact command as an exercise for the reader.
$ cat /tmp/tlsconvo2|xxd|less
But I'm not into crypto, even that I don't know what it means or if it's the way to go. I liked the initiative though :-)
Edit: But I do get 404s when I click the "language-links" on the challenge pages, like http://cryptopals.com/sets/1/challenges/1/ruby. What are those anyways?
http://www.amazon.com/Cryptography-Engineering-Principles-Pr...
Very bad idea to sign everything that comes your way, kind of like `eval` on text input.
Edit: here's a JavaScript implementation I wrote that does that, if anyone is interested in details: https://github.com/cryptocoinjs/coinmsg/blob/d2cb985dd9994f1...
for online signing we'd first need to implement the bitcoin protocol...
or am I getting something wrong?
[1] https://www.schneier.com/crypto-gram/archives/1998/1215.html...
I do hope you're logging all incoming data to a backup server somewhere, so you can analyze it afterwards if this were to happen.
But please tell us if you do. We'd like to learn from this exercise and improve the stack.
You can try to confuse the ASN.1 parser, or even the protocol level parser.
You can try to defeat certificate validation logic.
You can try to get handshake state-machine do an illegal transition.
You can try to smash its memory and either read it or get your code into it.
You can try to defeat its RNG.
It doesn't let you do adaptive-plaintext attacks, but everything else is up for grabs. And you don't necessarily have to wait for it to politely send you the bitcoin key - it's somewhere in there, in memory!
A bunch of people write crypto software, and want to find out/demonstrate how secure it is. They do so by setting up a system that will transfer ~$2k worth of bitcoins to the first guy who breaks it.
As the page (and my post) emphatically state, this contest cannot prove anything about how secure it is. That distinction is really important.