Commit Graph

4214 Commits

Author SHA1 Message Date
Nick Mathewson 87ea2b6655 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-28 11:22:39 -04:00
Nick Mathewson f87aa4555d Merge remote-tracking branch 'teor/bug18812' into maint-0.2.8 2016-06-28 11:12:51 -04:00
teor (Tim Wilson-Brown) 608c12baaf Resolve bug18812 by logging fallback key changes at info level 2016-06-28 14:18:16 +10:00
Nick Mathewson 5b57f88f60 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-27 13:20:57 -04:00
Yawning Angel 0116eae59a Bug19499: Fix GCC warnings when building against bleeding edge OpenSSL.
The previous version of the new accessors didn't specify const but it
was changed in master.
2016-06-24 22:20:41 +00:00
Nick Mathewson cc6fcbde4e Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-22 08:19:51 -04:00
teor (Tim Wilson-Brown) 421a7c8c35 Changes file for 19071 and 19480 2016-06-22 12:37:59 +10:00
Nick Mathewson cf13189064 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-21 09:00:37 -04:00
Ivan Markin b432efb838 Remove useless message about nonexistent onion services after uploading a descriptor 2016-06-21 09:00:22 -04:00
Nick Mathewson a839ed5cc1 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-21 08:54:39 -04:00
George Kadianakis f038e9cb00 Fix bug when disabling heartbeats.
Callbacks can't return 0.
2016-06-21 08:54:30 -04:00
Nick Mathewson 299f892815 One more changelog entry. 2016-06-14 13:42:48 -04:00
Nick Mathewson b74ce86830 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-14 12:23:00 -04:00
Yawning Angel b217e4ac65 Bug 19406: Add a changes file. 2016-06-14 12:13:09 -04:00
Nick Mathewson 8760325550 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-13 13:57:09 -04:00
Nick Mathewson 60b8aaefa1 lintChanges fixes 2016-06-13 13:57:03 -04:00
Nick Mathewson ef87106583 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-13 10:49:15 -04:00
Nick Mathewson 2ee3dbe801 Merge branch 'maint-0.2.7' into maint-0.2.8 2016-06-13 10:49:05 -04:00
Nick Mathewson 80089c9e7c Merge branch 'maint-0.2.6' into maint-0.2.7 2016-06-13 10:48:56 -04:00
Nick Mathewson b4bb88606e Merge branch 'maint-0.2.5' into maint-0.2.6 2016-06-13 10:48:48 -04:00
Nick Mathewson f25f7b759c Merge branch 'maint-0.2.4' into maint-0.2.5 2016-06-13 10:48:35 -04:00
Karsten Loesing c14c662758 Update geoip and geoip6 to the June 7 2016 database. 2016-06-12 11:35:50 +02:00
Nick Mathewson 2728a12232 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-11 10:16:36 -04:00
Nick Mathewson ada5668c5e Merge remote-tracking branch 'public/bug19203_027' into maint-0.2.8 2016-06-11 10:16:00 -04:00
Nick Mathewson 399eebea54 Merge branch 'maint-0.2.8' into release-0.2.8 2016-06-06 10:17:57 -04:00
Nick Mathewson 6eeedc02d8 Use directory_must_use_begindir to predict we'll surely use begindir
Previously, we used !directory_fetches_from_authorities() to predict
that we would tunnel connections.  But the rules have changed
somewhat over the course of 0.2.8
2016-06-02 10:40:39 -04:00
Nick Mathewson a32ca313c4 Merge branch 'maint-0.2.7' into maint-0.2.8 2016-06-02 10:12:56 -04:00
Nick Mathewson 5854b19816 Use tor_sscanf, not sscanf, in test_util.c.
Fixes the 0.2.7 case of bug #19213, which prevented mingw64 from
working.
2016-06-02 10:11:29 -04:00
Nick Mathewson bdc59e33c1 Fix a warning on unnamed nodes in node_get_by_nickname().
There was a > that should have been an ==, and a missing !.  These
together prevented us from issuing a warning in the case that a
nickname matched an Unnamed node only.

Fixes bug 19203; bugfix on 0.2.3.1-alpha.
2016-05-30 12:03:03 -04:00
Nick Mathewson b28acba3c3 Fold one more item into 0.2.8 changelog; hope it will be today? 2016-05-26 12:10:26 -04:00
Nick Mathewson 3e2d061397 Merge branch 'maint-0.2.8' into release-0.2.8 2016-05-25 16:58:58 -04:00
Nick Mathewson 36b2b48308 Merge branch 'bug18668_028' into maint-0.2.8 2016-05-25 16:58:43 -04:00
Nick Mathewson 693e48a5a4 Fold new entries into 0.2.8.3-alpha changelog. 2016-05-25 10:29:15 -04:00
Nick Mathewson 9d199893fe Merge branch 'maint-0.2.8' into release-0.2.8 2016-05-25 10:21:04 -04:00
Nick Mathewson 6d375f17fc Merge branch 'bug19161_028_v2' into maint-0.2.8 2016-05-25 10:17:26 -04:00
Nick Mathewson b5e2b3844a cMerge branch 'maint-0.2.8' into release-0.2.8 2016-05-25 09:27:35 -04:00
Nick Mathewson fdfc528f85 Merge branch 'bug19152_024_v2' into maint-0.2.8 2016-05-25 09:26:45 -04:00
Nick Mathewson c4c4380a5e Fix a dangling pointer issue in our RSA keygen code
If OpenSSL fails to generate an RSA key, do not retain a dangling
pointer to the previous (uninitialized) key value. The impact here
should be limited to a difficult-to-trigger crash, if OpenSSL is
running an engine that makes key generation failures possible, or if
OpenSSL runs out of memory. Fixes bug 19152; bugfix on
0.2.1.10-alpha. Found by Yuan Jochen Kang, Suman Jana, and Baishakhi
Ray.

This is potentially scary stuff, so let me walk through my analysis.
I think this is a bug, and a backport candidate, but not remotely
triggerable in any useful way.

Observation 1a:

Looking over the OpenSSL code here, the only way we can really fail in
the non-engine case is if malloc() fails.  But if malloc() is failing,
then tor_malloc() calls should be tor_asserting -- the only way that an
attacker could do an exploit here would be to figure out some way to
make malloc() fail when openssl does it, but work whenever Tor does it.

(Also ordinary malloc() doesn't fail on platforms like Linux that
overcommit.)

Observation 1b:

Although engines are _allowed_ to fail in extra ways, I can't find much
evidence online  that they actually _do_ fail in practice. More evidence
would be nice, though.

Observation 2:

We don't call crypto_pk_generate*() all that often, and we don't do it
in response to external inputs. The only way to get it to happen
remotely would be by causing a hidden service to build new introduction
points.

Observation 3a:

So, let's assume that both of the above observations are wrong, and the
attacker can make us generate a crypto_pk_env_t with a dangling pointer
in its 'key' field, and not immediately crash.

This dangling pointer will point to what used to be an RSA structure,
with the fields all set to NULL.  Actually using this RSA structure,
before the memory is reused for anything else, will cause a crash.

In nearly every function where we call crypto_pk_generate*(), we quickly
use the RSA key pointer -- either to sign something, or to encode the
key, or to free the key.  The only exception is when we generate an
intro key in rend_consider_services_intro_points().  In that case, we
don't actually use the key until the intro circuit is opened -- at which
point we encode it, and use it to sign an introduction request.

So in order to exploit this bug to do anything besides crash Tor, the
attacker needs to make sure that by the time the introduction circuit
completes, either:
  * the e, d, and n BNs look valid, and at least one of the other BNs is
    still NULL.
OR
  * all 8 of the BNs must look valid.

To look like a valid BN, *they* all need to have their 'top' index plus
their 'd' pointer indicate an addressable region in memory.

So actually getting useful data of of this, rather than a crash, is
going to be pretty damn hard.  You'd have to force an introduction point
to be created (or wait for one to be created), and force that particular
crypto_pk_generate*() to fail, and then arrange for the memory that the
RSA points to to in turn point to 3...8 valid BNs, all by the time the
introduction circuit completes.

Naturally, the signature won't check as valid [*], so the intro point
will reject the ESTABLISH_INTRO cell.  So you need to _be_ the
introduction point, or you don't actually see this information.

[*] Okay, so if you could somehow make the 'rsa' pointer point to a
different valid RSA key, then you'd get a valid signature of an
ESTABLISH_INTRO cell using a key that was supposed to be used for
something else ... but nothing else looks like that, so you can't use
that signature elsewhere.

Observation 3b:

Your best bet as an attacker would be to make the dangling RSA pointer
actually contain a fake method, with a fake RSA_private_encrypt
function that actually pointed to code you wanted to execute.  You'd
still need to transit 3 or 4 pointers deep though in order to make that
work.

Conclusion:

By 1, you probably can't trigger this without Tor crashing from OOM.

By 2, you probably can't trigger this reliably.

By 3, even if I'm wrong about 1 and 2, you have to jump through a pretty
big array of hoops in order to get any kind of data leak or code
execution.

So I'm calling it a bug, but not a security hole. Still worth
patching.
2016-05-25 09:23:57 -04:00
Nick Mathewson 6abceca182 Merge branch 'memarea_overflow_027_squashed' into maint-0.2.8 2016-05-25 09:22:02 -04:00
Nick Mathewson be2d37ad3c Fix a pointer arithmetic bug in memarea_alloc()
Fortunately, the arithmetic cannot actually overflow, so long as we
*always* check for the size of potentially hostile input before
copying it.  I think we do, though.  We do check each line against
MAX_LINE_LENGTH, and each object name or object against
MAX_UNPARSED_OBJECT_SIZE, both of which are 128k.  So to get this
overflow, we need to have our memarea allocated way way too high up
in RAM, which most allocators won't actually do.

Bugfix on 0.2.1.1-alpha, where memarea was introduced.

Found by Guido Vranken.
2016-05-25 09:20:37 -04:00
Nick Mathewson be3875cda2 Make sure that libscrypt_scrypt actually exists before using it.
Previously, if the header was present, we'd proceed even if the
function wasn't there.

Easy fix for bug 19161.  A better fix would involve trying harder to
find libscrypt_scrypt.
2016-05-24 10:31:02 -04:00
Nick Mathewson 2b8ba551d3 Fold new changelog items in 2016-05-19 08:56:06 -04:00
Nick Mathewson 0a05afa96d Merge branch 'maint-0.2.8' into release-0.2.8 2016-05-19 08:54:30 -04:00
Nick Mathewson dd17df2253 lintchanges on 18809, and fix the bug number 2016-05-19 08:54:19 -04:00
Nick Mathewson c4b7b4ad4b Merge branch 'maint-0.2.8' into release-0.2.8 2016-05-19 08:29:52 -04:00
Nick Mathewson 7c7d990704 changelog typo fix 2016-05-19 08:29:45 -04:00
Nick Mathewson 1e97b6afc6 Merge branch 'maint-0.2.8' into release-0.2.8 2016-05-19 08:17:11 -04:00
Nick Mathewson 9f217c83b0 Merge branch 'bug18809_028_squashed' into maint-0.2.8 2016-05-19 08:17:02 -04:00
teor (Tim Wilson-Brown) 8dc8d71226 Changes file for bug 18809 2016-05-19 07:58:40 -04:00
Nick Mathewson 3f49474349 Merge branch 'bug17150_027_extra' into maint-0.2.8 2016-05-17 19:47:22 -04:00