00:55:27 | dooglus_: | dooglus_ is now known as Guest21566 |
00:57:12 | Guest21566: | dht are inherently slow, i wonder how maidsafe can promise fast internet with their dht |
00:59:28 | gmaxwell: | I promise free 1lb gold bars to everyone who says gmaxwell is grand! |
01:00:08 | gwillen: | Señor gmaxwell es muy grande! |
01:01:07 | Luke-Jr: | gmaxwell is grand! |
01:01:24 | gmaxwell: | (this was a joke in response to Guest21566; all gold bars that I know of are propritary in any case… :P ) |
01:01:57 | nsh-: | * nsh- leverages gmaxwell-promise-backed derivatives |
01:02:19 | sipa: | * sipa integrates those |
01:02:39 | gwillen: | * gwillen takes out CDSes on gmaxwell's gold-bar debt |
01:03:36 | Guest21566: | oh my god ripple is getting traction |
01:03:54 | gmaxwell: | haha |
01:04:58 | Guest21566: | ripple is doing it the right way |
01:05:15 | Guest21566: | compare to open transactions which idk what they are doing or thinking. |
01:05:31 | Guest21566: | very shady company |
01:06:56 | kanzure: | no ban hammers? |
01:08:30 | Guest21566: | kanzure are you developing any bitcoin related projects? |
01:15:07 | andytoshi: | kanzure: there are no banhammers here except for overt six-year-old style trolling |
01:15:45 | andytoshi: | which is unfortunate, but new people would probably not get a chance to learn otherwise ;) |
01:29:53 | woah: | Can't tell if bs or not: http://www.otonomos.com/ |
01:32:33 | Adohgg: | Adohgg is now known as cholobear |
02:28:46 | cholobear: | cholobear is now known as adohgg |
02:50:08 | berndj-blackout: | berndj-blackout is now known as berndj |
03:22:50 | fanquake: | fanquake has left #bitcoin-wizards |
06:00:49 | petertodd: | gmaxwell sucks (do I get a -1lb gold bar now?) |
06:01:21 | kanzure: | petertodd: i just lost a few hours not believing your warning in https://github.com/petertodd/python-bitcoinlib/blob/master/examples/spend-p2sh-txout.py |
06:01:31 | kanzure: | petertodd: in the future i will be more trusting of your asserts i guess |
06:01:45 | kanzure: | (python3/python2 differences) |
06:02:25 | petertodd: | kanzure: haha |
06:02:32 | kanzure: | (pm) |
06:02:45 | petertodd: | I'm one of those programmers whose bought into the Python3 upgrade :) |
08:05:16 | kornbluth.freenode.net: | topic is: This channel is not about short-term Bitcoin development | http://bitcoin.ninja/ | This channel is logged. | For logs and more information, visit http://bitcoin.ninja |
08:05:16 | kornbluth.freenode.net: | Users on #bitcoin-wizards: andy-logbot arubi wallet42 Guyver2 artifexd iang nuke1989 jtimon go1111111 coinheavy ericp4 koshii SDCDev [7] kmels contrapumpkin jchp spinza Logicwax c0rw1n_ melvster roconnor kanzure altoz puszl Brizo wiretapped nanotube espes__ Starduster justanotheruser andytoshi Guest72851 x48 samson_ gavinandresen MoALTz mortale Ress atgreen hashtag hollandais mkarrer rfreeman_w Adlai so zibbo Transisto drawingthesun emsid jrayhawk Hunger- irc88_ |
08:05:16 | kornbluth.freenode.net: | Users on #bitcoin-wizards: devrandom nsh lnovy pi07r Emcy dansmith_btc epscy tacotime comboy Graftec grandmaster2 LarsLarsen arowser OneFixt Meeh jgarzik Fistful_of_coins BlueMatt Sangheili dgenr8 NikolaiToryzin tromp__ tromp ebfull wizkid057 a5m0 digitalmagus8 HaltingState prepost Grishnakh iddo starsoccer midnightmagic adohgg jaekwon berndj gribble Graet kinlo zenojis [Derek] Dyaheon pigeons lianj_ UukGoblin optimator BrainOverfl0w wumpus Apocalyptic poggy rs0 |
08:05:16 | kornbluth.freenode.net: | Users on #bitcoin-wizards: jcorgan_ Iriez mr_burdell fluffypony K1773R bbrittain SomeoneWeird forrestv livegnik Anduck amiller Nightwolf Keefe Krellan BigBitz [\\\] Taek42 warren asoltys waxwing EasyAt sl01 Luke-Jr sipa coryfields [d__d] bobke nsh- pajarillo crescendo HM phantomcircuit gmaxwell DoctorBTC harrow roasbeef mmozeiko Eliel CodeShark throughnothing Guest47516 Alanius nickler_ ryan-c gwillen otoburb smooth helo Guest50253 abc56889 lechuga_ TD-Linux catcow |
08:05:16 | kornbluth.freenode.net: | Users on #bitcoin-wizards: danneu LaptopZZ burcin petertodd phedny @ChanServ |
11:04:09 | nsh-: | andytoshi, is the alts.pdf on wpsoftware the lastest draft? |
11:19:57 | Luke-Jr: | nsh-: likely |
11:20:08 | nsh-: | k |
11:51:47 | maaku: | maaku is now known as Guest94970 |
12:32:55 | andytoshi: | nsh-: yes |
12:34:24 | nsh-: | ty |
13:24:39 | andytoshi: | gmaxwell: (all this modulo me actually working through the detailed security argument) so, we can get N-of-M with BRS ... when specifying each output, also specify either the bitmask or merkle paths which describe the additive N-of-N that you are doing (this is visible so verifiers can check the threshold is met) |
13:24:54 | andytoshi: | the key image, rather than being the image of all N keys added together, is the image of all M keys added together |
13:25:03 | andytoshi: | so you cannot double-spend by using different subsets of keys |
13:26:01 | andytoshi: | note that you can specify a different N for every output you include in the ring ... though i think for privacy you'd pretty much need them to be the same, the stats seem really complicated otherwise and i don't think you can communicate no information |
13:27:03 | andytoshi: | (in fact, rather than using the image of all M keys, we could even use a MAST root, but i can't see how this is useful..) |
13:29:02 | andytoshi: | oh, i guess it lets you have a script without enabling double-spending, and still use ringsigs for the case when your script demands a signature input. but doesn't let you blind the script |
13:29:07 | gmaxwell: | MAST doesn't help for BRS, I think— for plausability everyone must know the data in tree, so you get no data hiding savings. but the non-tree verifier addition approach should work equally. |
13:48:50 | andytoshi: | if we have weights, is that equivalent in expressivity to having boolean functions? |
13:52:31 | gmaxwell: | I think it is, but with a huge catch; the magnitude of the weights are exponential in the number of bits you're mapping over, in the worst case. |
13:52:48 | andytoshi: | i buy that |
13:53:28 | andytoshi: | i feel like we are very close to getting atomic chain swaps (and i think this implies coinswap) within BRS |
13:55:12 | andytoshi: | as i mentioned last night we can get almost-hash-commitments with tree-based N-of-M by having 2-of-2 with keys that are negatives of each other, then anyone can forge sigs once they know the pks (which are initially hidden behind a merkle root but will be exposed on first spend) |
13:55:54 | andytoshi: | this is "almost" because you can't demonstrate to anyone that this is actually a hash-commit prior to revealing the preimage |
13:56:52 | gmaxwell: | (if you didn't buy the weights comment, I would have pointed out there is a counting argument) |
13:57:45 | andytoshi: | it just seems intuitively right, if i've got a proposition p and i do A || p, seems like the weight on A would need to overwhelm the weights of p |
14:02:12 | andytoshi: | overwhelm the minimum sum of weights guaranteed to satisfy p* |
14:03:09 | andytoshi: | then there is some "no perfect compression" intuition that you usually can't compact this minimum sum past the "every additional symbol makes you double the total weights in play" |
14:03:27 | andytoshi: | which maybe is your counting argument |
14:06:07 | gmaxwell: | hm. actually plain linear weights with a threshold can't quite be universal. Go construct xor. |
14:07:42 | andytoshi: | ah, yes, you're right, only AND and OR ... this is true of ABE as well, the way they solved it was to "add NOT" by doubling the set of attributes, "{a, b, c, not a, not b, not c}" and promising never to use "a and not a" :) |
14:07:55 | andytoshi: | but in our case there is no "not key" we can use |
14:08:14 | gmaxwell: | basically the criteria amounts to linear seperability, if you imagine the satisfactions in 2^n space, you can get a linear threshold if you can fit a cutting hyperplane that precisely seperates. |
14:08:51 | andytoshi: | that's a good intuition |
14:09:26 | gmaxwell: | andytoshi: the counting argument was just that there are 2^2^n boolean functions over n inputs. so this suggested to me that the worst case weights would have be large. |
14:11:35 | andytoshi: | for hash-commit maybe there is something like, if you do 2-of-2 with keys P and 2P, then the structure of the ringsig causes the private key to be revealed when spent, but is safe before even if the pubkeys are known |
14:12:59 | andytoshi: | that doesn't work, but there's a lot of design space to explore here... note also that you can do OOB nizks of equality of discrete logs (this is roughly what the ringsigs are made of in the first place!) |
14:13:55 | maaku: | maaku is now known as Guest20473 |
14:14:06 | andytoshi: | or maybe, just add a consensus rule that if you do 2-of-2 with keys P and 2P, your nonces all have to be 1 :P |
14:15:52 | gmaxwell: | okay, so polynomal thresholds of order <= n are universal... which is kinda ugly. |
14:16:29 | andytoshi: | n == # of keys |
14:16:32 | andytoshi: | ? |
14:16:54 | gmaxwell: | yea. |
14:17:26 | gmaxwell: | (I mean the worst case is order = n, so an exponential blowup in the number of required weights) |
14:19:01 | gmaxwell: | I suppose I shouldn't be surprised, considering that e.g. for 256 bit hash H() does H(x)==y is not something you're going to compute with just a couple multiplies. :) |
14:37:18 | gmaxwell: | andytoshi: hmm.. though for checksig we don't want arbitary bool functions... in that it's okay for you to turn additional 1s to zeros until you get the right answer. in this case, I think an exact test (not a threshold) may be universal but I'm not sure. |
14:39:07 | andytoshi: | oh, good point |
14:39:38 | andytoshi: | i don't have a usecase in mind beyond A || (B && C), which can easily be done with weights, was just curious.. |
14:53:05 | gmaxwell: | (A0 && A1 && A2 && ...) || (B0 && B1 && B2 && ...) is a fun pattern. |
15:04:38 | nsh-: | what are you guys talking about now? i'm lost |
15:05:01 | nsh-: | there's a way of computing b*coin ring (threshold) signatures using bitmasks? |
15:09:48 | gmaxwell: | nsh-: sort of two parallel but related things. |
15:11:20 | gmaxwell: | I presented a (kind of obvious) way to get a fairly efficient non-interactive N of M threshold signature out of schnorr signatures, which have a non-interactive N of N threshold signature. |
15:11:43 | nsh-: | * nsh- nods |
15:12:17 | gmaxwell: | andytoshi also determined that the same N of N scheme that works for schnorr works for the bytecoin ring signature. |
15:12:37 | nsh-: | oh, cool |
15:12:45 | gmaxwell: | and he also figured out how to make the N of M transform work without breaking the BRS. |
15:12:50 | nsh-: | so, transitively.... right |
15:12:54 | nsh-: | nice |
15:13:35 | gmaxwell: | He's trying to figure out how to do a coinswap which requires a A || (B&&C) with some special conditions. |
15:13:57 | gmaxwell: | You can get an A||(B&&C) out of a linear weighed threshold scheme. |
15:14:35 | nsh-: | A B C represent possible inputs? |
15:14:52 | nsh-: | no, signatures |
15:15:28 | gmaxwell: | yes, pubkeys/signatures... so thats a boolean expression, instead we can replace it with A*Wa + B*Wb + C*Wc >= T and set the weights to 2, 1, 1 and the threshold to 2. |
15:15:59 | maaku: | maaku is now known as Guest48704 |
15:16:25 | nsh-: | hmmm |
15:16:37 | gmaxwell: | so e.g. a minor extension to a threshold scheme to have weights greatly increases the space of expressable functions. |
15:17:01 | nsh-: | * nsh- nods |
15:17:13 | nsh-: | interesting to see how these would map onto contractual/game/transactional situations |
15:17:42 | gmaxwell: | andytoshi asked if it was univeral. E.g. can you express any predicate with just the weights. |
15:18:32 | gmaxwell: | The answer is no, e.g. you cannot express xor that way. Though you can generalize it to be universal, but you may need a whole lot of weights. |
15:18:57 | nsh-: | what property of the algebra prevents the XOR logic? |
15:20:12 | gmaxwell: | for n bit input you can imagine a n dimensional space where an all the inputs are points. |
15:20:35 | gmaxwell: | The threshold scheme can be seen as defining a cutting hyperplane that seperates the points into pass/fail. |
15:20:49 | nsh-: | * nsh- nods |
15:21:07 | gmaxwell: | in the xor case, the points are colinear and there is no cutting plane that seperates them. |
15:21:56 | nsh-: | oh |
15:22:07 | gmaxwell: | for two inputs you can imagine making a decision table and drawing a line through it. |
15:22:40 | gmaxwell: | amusingly, you _can_ get a NAND that way, so a stack of linear thresholds is universal... but a single one is not. |
15:23:10 | nsh-: | . o O { i wonder if there's a 'deep' relationship between universality and geometric degeneracy and reversibility (destruction of information) } |
15:24:58 | gmaxwell: | though for predicates on signatures; we don't actually care about arbritary boolean expressions. |
15:25:50 | nsh-: | * nsh- nods |
15:25:59 | gmaxwell: | e.g. you'd never want A xor B .. because the signer can always omit some keys, so A xor B is really the same as A OR B. |
15:27:11 | gmaxwell: | and the space of these uhhh boolean sufficiency functions is much smaller than all boolean functions. |
15:27:22 | gmaxwell: | so maybe linear weights really are general for them, I dunno. |
15:28:09 | nsh-: | shades of heuristica... |
15:29:21 | gmaxwell: | pieter and I have been talking about a new checksig operator, with the goal of being schnorr based and supporting efficient non-interactive thresholds (or, at least, more efficent than checkmultisig). Linear weights are an obvious improvement to support, as they're very useful and easy. But are they universal for the kinds of functions we want? Is there some minor enhancement that makes them universal? |
15:32:21 | gmaxwell: | e.g. for two input functions having the additional two quadraic weights is universal... but thats kinda dumb since there are only 16 possible boolean functions on 2 inputs to begin with. (several of them being stupid; there are only two interesting sufficiency-functions the and and the or case) |
15:32:41 | nsh-: | * nsh- nods |
15:33:08 | gmaxwell: | presumably there is some proper name for what I'm calling sufficiency-functions and if I figure it out I'll find there is literature on it. |
15:35:10 | nsh-: | is there a way to taxonomise the 'kinds of functions we want'? |
15:49:05 | andytoshi: | one sec, i'll check the ABE paper because they have the same class of functions (and iirc they had a name..) |
15:49:52 | andytoshi: | "monotone span program" |
15:50:54 | andytoshi: | that's not quite right, a MSP is something different but the class of computable functions supported by MSP is the same as that for LSSS, which is the same as that for threshold gates |
15:53:59 | andytoshi: | s/computable/efficiently computable/ |
15:56:50 | andytoshi: | the "monotone" is because as gmaxwell says, anyone can change 1's to 0's, so if you have an accepting input for some program P, you've also got an accepting input for any program that accepts subsets of P's inputs |
16:03:09 | andytoshi: | gmaxwell: schnorr n-of-n is not quite noninteractive, you have to agree on the nonce sum beforehand ... so half a round of interaction |
16:04:55 | andytoshi: | what we care about more is that the resulting sig looks identical for all n (including n = 1), and if you add the pubkeys beforehand it'll be indistinguishable from the single-signer case |
16:06:58 | gmaxwell: | andytoshi: yea, I mean no signing time interaction is required, just setup interaction. |
17:21:32 | gmaxwell: | http://en.wikipedia.org/wiki/Dedekind_number |
17:26:35 | ahmed_ZzZz: | ahmed_ZzZz is now known as ahmed_ |
17:32:05 | gmaxwell: | Interesting that there are 56130437228687557907788 monotone boolean functions for n=8... well alas, seems unlikely that we'll find a compact and reasonably simple optimal encoding for them. |
17:39:12 | sipa: | gmaxwell: why restrict to monotone ones? |
17:39:30 | sipa: | right... we don't care about "but that guy is not allowed to sign!" |
17:45:54 | andytoshi: | gmaxwell: oh, i realized that my N-of-M transform is not as simple as i thought earlier |
17:45:57 | nsh-: | hmm, https://en.wikipedia.org/wiki/Antichain is interesting |
17:46:53 | andytoshi: | key image in BRS is xH(xG), i had observed that you can replace xG with the sum of all M pks, but there is still that pesky first `x` which is the sum of only N keys |
17:47:22 | nsh-: | gmaxwell, sure 56130437228687557907788 isn't n=9 ? |
17:47:30 | nsh-: | oh, maybe not "Even the empty set has two antichains in its power set: one containing a single set (the empty set itself) and one containing no sets. |
17:47:36 | sipa: | nsh-: n=9 isn't even known |
17:47:44 | nsh-: | * nsh- nods |
17:47:45 | andytoshi: | but this is fine, you can just do SSSS where each signing key is actually a shamir secret share, and validators can compute the corresponding pubkey |
17:48:12 | andytoshi: | so the result is xH(xG) where both x's are a shared secret amongst the M signers, and will be the same no matter which M of N are chosen |
17:48:20 | sipa: | andytoshi: hmm, the signing nonce needs to be known to all signers? isn't this a problem? |
17:48:31 | andytoshi: | sipa: no, that's not the case |
17:48:40 | nsh-: | it isn't? |
17:49:14 | andytoshi: | sipa: like in additive schnorr you sum up k_i - x_iM, and nobody can separate the individual k_i's or x_i's |
17:49:53 | andytoshi: | sipa: i'm saying, now instead of x_i you use sum_{m,n} (x_i - n)/(m - n) which gives you a shamir secret share |
17:50:05 | andytoshi: | but nothing secret has become public or vice-versa |
17:50:48 | nsh-: | but all parties still have to agree on a nonce sum, no? |
17:51:10 | andytoshi: | nsh-: yes, but that's fine, they have nonces q_i, and agree on a sum of q_iG's |
17:51:23 | andytoshi: | s/q_i/k_i/ sorry, i'm crossing notations here |
17:51:39 | sipa: | ah, right |
17:53:29 | nsh-: | gmaxwell, this is the geometrical representation of the sufficiency cutting hyperplanes(surfaces)? https://en.wikipedia.org/wiki/Abstract_simplicial_complex |
17:53:54 | nsh-: | (dedekind numbers count them) |
17:54:25 | nsh-: | or is that a coincidence, hmm |
17:54:44 | andytoshi: | i doubt it's a coincidence.. |
17:55:32 | andytoshi: | if you rotate a simplicial complex of dimension n so that n faces are the coordinate planes, then the remaining face will be the "cutting hyperplane" that gmaxwell referred to |
17:55:36 | andytoshi: | (i think) |
17:55:41 | andytoshi: | that gives an exact correspondence |
17:57:58 | nsh-: | interesting |
17:58:28 | andytoshi: | n faces will be the "coordinate hyperplanes" rather which are oriented along every axis but one :P |
17:58:35 | andytoshi: | it's hard to visualize |
17:59:17 | andytoshi: | but eg for a 2-simplex (triangle) you have one along x axis (all except y) one along y axis (all except x). for a 3-simplex (pyramid) you have one on xy plane (all except z), etc |
18:00:00 | nsh-: | * nsh- nods |
18:04:24 | andytoshi: | above i said sum_{m,n} (x_i - n)/(m - n) ... what i meant was x_n prod_{i≠n} (x - n)/(i - n) evaluated at 0. (not that this affects anything, but i ought to be correct :)) |
18:18:47 | andytoshi: | actually i think this secret-sharing thing is more general ... lets you do N-of-M additive schnorr which looks like 1-of-1 (so only one pk is published) |
18:18:53 | andytoshi: | i will run through the algebra, seems too good to be true.. |
18:19:40 | andytoshi: | gmaxwell: can you post your sage worksheet with all the secp256k1 params? (i will put it on bitcoin.ninja if you don't) |
18:25:07 | gmaxwell: | n of m additive schnoor which looks like 1 of 1 is a known thing, but the constructions I knew about required signing time full roundtrip interaction which is really burdensom (imagine three people have offline wallets and are doing a 3 of 5) |
18:25:19 | gmaxwell: | er schnorr. |
18:27:07 | andytoshi: | interesting |
18:27:14 | andytoshi: | i'm pretty sure i've written down a noninteractive one |
18:28:40 | andytoshi: | why can't all M parties generate key x, nonce k, publish (i, x_iG, k_iG) (where i is their index, I assume they can order themselves somehow) |
18:29:09 | andytoshi: | then you do lagrange interpolation to generate (key, nonce) (xG, kG) from any N of these.. |
18:29:38 | andytoshi: | all signers do a schnorr sig with x_i of h = H(m||kG), then do lagrange interpolation on the sigs themselves to get s = x - kh |
18:29:41 | andytoshi: | and (s, h) is the sig |
18:30:16 | gmaxwell: | andytoshi: is my sage worksheet at a url already or did I pastebin it to you? |
18:30:31 | andytoshi: | iirc you posted a url here at some point |
18:30:34 | andytoshi: | i'll look for it |
18:36:46 | gmaxwell: | I found it, doesn't seem to be online, I'll put it online. |
18:37:48 | andytoshi: | oh, and should i submit the CN whitepaper to bitcoin.ninja? |
18:37:53 | andytoshi: | i have a wpsoftware.net hosted copy.. |
18:45:40 | gmaxwell: | andytoshi: https://github.com/TheBlueMatt/bitcoinninja/pull/5 |
18:46:00 | andytoshi: | thx, i'll play with this, if it works maybe you and i and nsh- will do a 2-of-3 |
19:19:35 | SDCDev: | * SDCDev takes off his robe and wizard hat |
19:25:30 | andytoshi: | oh, i'm being an idiot, what i'm doing is not SSSS (SSSS requires a dealer) |
19:27:30 | andytoshi: | also crap, this means i don't have a brs-compatible N-of-M |
19:27:41 | gmaxwell: | oh ha. |
19:27:57 | gmaxwell: | I was a bit confused as to how you were doing this but expected you to enlighten later. |
19:28:31 | gmaxwell: | Obviously a dealer needing form is totally useless around here. (I'm not sure why so many academic papers waste their time on models like that…) |
19:28:56 | andytoshi: | yeah, very irritating |
19:29:08 | andytoshi: | there was a non-dealer-using paper recently that used obfuscation :P |
19:32:38 | Gnosis: | how do you all feel about smart pointers in C++ (specifically boost::shared_ptr)? |
19:33:48 | andytoshi: | so, fwiw we can "salvage" the N-of-M scheme by having all potential signers interactively precompute the key image. this is bad ofc because ideally nobody should know it except the actual signers |
19:37:42 | andytoshi: | plus it's a pretty gross computation, and they might have to do a separate computation for all N-choose-M signersets |
19:39:57 | gmaxwell: | Gnosis: They're useful? not sure what you're looking for... they're a part of C++ as of C++11. I generally prefer unique_ptr whenever possible over just slathering things with the refcounting version. |
19:40:50 | sipa: | Gnosis: offtopic here, imho |
19:41:12 | Gnosis: | I ask because they seem useful to me too, yet they are nearly absent from Bitcoin source |
19:41:20 | Gnosis: | sipa: okay, noted |
19:41:45 | sipa: | Gnosis: if you're talkig about bitcoin development, see #bitcoin-dev |
19:43:10 | gmaxwell: | Gnosis: I don't think there is much use for shared_ptr in bitcoin core; the memory managment patterns are well defined enough that they aren't needed. |
19:43:46 | gmaxwell: | (usually once you go down the refcounting route you can no longer reason about the worst case resource usage) |
19:51:56 | nsh-: | (why's that?) |
19:52:14 | sipa: | please, #bitcoin-dev |
19:52:24 | nsh-: | ((soz)) |
19:56:14 | Gnosis: | gmaxwell: ah, got it. Thanks! |
20:34:48 | HobGoblin: | HobGoblin is now known as Guest94465 |
20:44:07 | SDC: | SDC is now known as SDCDev |
20:47:03 | jbenet_: | jbenet_ is now known as jbenet |
21:48:51 | DougieBot5000_: | DougieBot5000_ is now known as DougieBot5000 |
21:49:26 | warren_2: | warren_2 is now known as warren |
22:50:30 | phantomcircuit: | https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762923#10 |
22:50:33 | phantomcircuit: | we have a winner! |
22:53:15 | gwillen: | the bash script export feature is going to have to go |
22:53:22 | gwillen: | that will be the final resolution |
22:53:30 | nsh-: | bash maintainer isn't keen on the idea |
22:53:37 | nsh-: | there's already a patch that makes it a compile-time option |
22:53:56 | gwillen: | bash maintainer is going to get steamrolled |
22:54:03 | gwillen: | so far two patches and two failures |
22:54:17 | nsh-: | remains to be resolved. there's a memory corruption in the offing since the last patch though, so i guess he's going to be overruled on the matter |
22:54:22 | gwillen: | yep |
22:54:42 | nsh-: | i have some sympathy for this view though: http://paste.lisp.org/display/143864 |
22:54:45 | gwillen: | the feature could be made safer by prefixing the vars |
22:55:00 | nsh-: | tl;dr -- it's a problem with shells being used outside of spec, partly because there is no spec |
22:55:03 | gwillen: | mah |
22:55:06 | gwillen: | er, meh |
22:55:19 | gwillen: | no spec for shells, no spec for anything |
22:55:27 | nsh-: | * nsh- smiles |
22:55:50 | gwillen: | that doesn't mean you can't call it a bug if it does something nobody wanted it to do, not even the author |
22:56:18 | gwillen: | (typing on phone keyboard, typing speed limited :-) |
22:56:21 | gmaxwell: | anything passing network input to a @#$@ shell (or anything like a shell) is pretty nuts to begin with. |
22:56:29 | gwillen: | ehhhhhh |
22:56:43 | gwillen: | we have been doing this for yeeeeeears |
22:56:51 | gwillen: | lots if things in unix are shell scripts |
22:56:56 | gmaxwell: | (this was one of the reasons I cited against the foo notify stuff in bitcoind, though at least there is very very narrowly confined) |
22:57:04 | gmaxwell: | Yes, doesn't mean it isn't nuts. |
22:57:07 | gwillen: | shrug |
22:57:40 | gwillen: | you only get to say it's nuts if you could have predicted it was nuts _before_ it got exploited :-P |
22:57:45 | gmaxwell: | it's certantly not the first time we've had env var loading attacks. |
22:58:08 | gwillen: | hmm, I mean I'm sure we had to learn abour PATH the jard way |
22:58:10 | gwillen: | hard* |
22:58:26 | gwillen: | perhaps that should have been our warning sign |
22:58:27 | gmaxwell: | path, ldpreload, termios, |
22:59:05 | gmaxwell: | there have been a half dozen vectors where you take something that normally doesn't get network input and give it network input via an obscure channel half the people don't know about and evil happens. |
22:59:13 | gwillen: | but the security boundary as long as I have understood it has been implicitly "no user control over env var names" |
22:59:26 | gwillen: | which bash violated here on its end |
23:01:06 | nsh-: | i think the main issues is a lack of robustness that's (relatively-)inherently traded off against power of shells scripting in association with network events and linux probably should be evolving to a position of more security through architectural design than judicious administration |
23:01:25 | nsh-: | there are more things to administer these days than judicious people |
23:01:38 | gwillen: | nod |
23:01:51 | gwillen: | this was not an administration isse though |
23:01:54 | gmaxwell: | hm? * is passing data to bash in enviroment variables and bash is doing things the caller didn't expect. The problem is pasing data in enviroment variables and thinking you can whitelist your way to safty. |
23:02:17 | gwillen: | lots of standard components pass untrusted data in env vars by design |
23:02:25 | gwillen: | this is not a configuration issue |
23:02:46 | gwillen: | and the idea that you will ever keep all untrusted data out of env vars is not realistic |
23:02:50 | nsh-: | but that design is a historical legacy and requires a continuity of the culture that remembers these norms of sanitization |
23:02:50 | gmaxwell: | gwillen: yes and every one of them has been exploitable multiple times in the past. |
23:02:59 | nsh-: | and clearly that's fallen by the wayside |
23:03:24 | gwillen: | you will never ever get all untrusted data out of env vars, though |
23:03:25 | phantomcircuit: | gwillen, the issue has nothing to do with bash |
23:03:29 | gwillen: | not in a million years |
23:03:48 | phantomcircuit: | environment variables should not contain remote unsanitized user input |
23:04:05 | gwillen: | the cgi standard, which yes is antiquated, _requires_ putting user input in env vars |
23:04:19 | gwillen: | do you expect those legacy apps to just go away? |
23:04:22 | phantomcircuit: | gwillen, so then consider cgi to be insecure by design |
23:04:23 | gmaxwell: | gwillen: whats more fun is that the env is passed onto every subprocess; which means that it's not just bash's security behavior you have to worry about but everything it calls, including potentially a lot of other things that also were never written with untrusted input in mind. |
23:05:24 | gmaxwell: | yes, cgi does. But cgi is old and has long been home to many secuity issues; it's also a trivial fork bomb in most configurations. |
23:05:46 | nsh-: | it's a shame we can't lay out the entire landscape of possible execution flows of the programs on a device and be able to see at a glance which streams of information are user/network controlled -- systemwise taint analysis |
23:06:11 | nsh-: | i guess that's towards the impossible side of ambitious |
23:06:26 | gmaxwell: | tagged memory can do this (e.g. valgrind uninit checking) but its expensive and less useful than you'd think. |
23:06:36 | phantomcircuit: | ^ that |
23:06:38 | nsh-: | why less useful? |
23:06:43 | gmaxwell: | there are papers on doing this, language extensions. |
23:06:58 | phantomcircuit: | gmaxwell, iirc there are actually commercial versions that work slightly better... but which are insanely expensive |
23:07:19 | gmaxwell: | nsh-: taint tends to flow everywhere... valgrind does a ton of work to suppress irrelevant results... e.g. it tracks the taint around but only tells you when it changes control flow. |
23:07:30 | nsh-: | * nsh- nods |
23:07:54 | gwillen: | it feels to me like you are trying to draw a security boundary in a place it does not naturally want to go |
23:08:09 | gwillen: | which is going to fail, which will give results no better than leaving it alone, and potentially worse |
23:08:24 | gwillen: | there are an infinite number of apps that pass data in environment variables |
23:08:30 | gwillen: | and a very large number that pass untrusted data there |
23:08:33 | gwillen: | and you can't control all of them |
23:08:48 | gmaxwell: | gwillen: otherwise it's the whole system. _you do not know_ what j-random-program-never-designed-for-network-input is going to do based on the enviroment. |
23:09:00 | phantomcircuit: | gwillen, there are actually very few which pass untrusted user input in environment variables |
23:09:31 | phantomcircuit: | cgi and weird uses of ssh being the only two i can think of at this point |
23:09:52 | gwillen: | it's not a small number, phantomcircuit |
23:09:53 | phantomcircuit: | (dhcpcd no longer passes unsanitized values using environment variables) |
23:09:59 | gwillen: | both major dhcp clients do it |
23:10:04 | gwillen: | okay, one major dhcp client does it |
23:10:09 | phantomcircuit: | gwillen, not for very long they dont |
23:10:12 | gwillen: | all djb software does it |
23:10:16 | gwillen: | and I'm sure some people will laugh at that, but. |
23:10:26 | phantomcircuit: | gwillen, then all djb software is insecure by design |
23:10:26 | gwillen: | openvpn does it |
23:10:37 | gwillen: | and we don't even know the beginning of the list |
23:10:46 | gwillen: | I guarantee that for every piece of software mentioned, there are 10 more we don't know about |
23:10:52 | gwillen: | and you will never ever find them all |
23:10:57 | gmaxwell: | I agree lots of things do it. I've specifically avoided doing it in the past simply because it was impossible to figure out if it was secure or not. |
23:11:00 | phantomcircuit: | gwillen, it's a widespread security anti-pattern |
23:11:11 | phantomcircuit: | that does not mean that the root issue is bash |
23:11:12 | gwillen: | I don't disagree that it's worth avoiding |
23:11:21 | gwillen: | but security by looking very angry at how stupid peole are is not a strategy |
23:11:30 | phantomcircuit: | indeed it's so widespread that i can basically guarantee that there are other things with the same "issue" that bash has |
23:11:31 | gmaxwell: | hm? I never said anyone was stupid. |
23:11:40 | phantomcircuit: | gmaxwell, to be fair i did |
23:12:18 | gmaxwell: | They're not stupid. This is impossibly hard. Which is why you don't want to use things like env variables, because it's impossible to make progress on the question "what code touches this potentially malicious input". |
23:12:26 | gwillen: | you can theorize about how many apps do X or Y, but in practice we have lots of examples of apps that put user input in env vars, and exactly one contemporary example of an app that accidentally executes their contents |
23:12:37 | gwillen: | I agree that maybe we should stop doing the former |
23:13:00 | gwillen: | but it's a lot easier to stop executing the contents of env vars than to stop giving them user-controlled contents |
23:13:12 | gmaxwell: | "Why not both?" |
23:13:14 | gwillen: | sure, do both |
23:13:23 | gwillen: | but the latter is going tobbe a long hard slog |
23:13:27 | nsh-: | * nsh- rings the consensus bell |
23:13:30 | gwillen: | and it's going to take the better part of a decade, I supect, to root it all out |
23:13:36 | gwillen: | and even then it won't be complete |
23:13:43 | gwillen: | you're going to have CGI users into the next century probably :-P |
23:14:03 | gmaxwell: | anything that does this is a trivally DOS vulnerable in any case; so obviously we need more DOS attacks. :) |
23:14:18 | gwillen: | that seems unlikely to me |
23:14:26 | gwillen: | it's trivial to control the length of user input |
23:14:30 | gwillen: | it's a lot hard to control the contents |
23:14:31 | phantomcircuit: | gmaxwell, well yes that was my point, it's obviously very very difficult to verify correctness with env vars.... so using them to pass user input is a bit daft |
23:14:34 | gmaxwell: | "I fork a shell based on a user request" is pretty awful. |
23:14:51 | gwillen: | that's a strawman and you know it :-P |
23:15:00 | gwillen: | dhclient/dhcpcd do not fork shells based on remote input |
23:15:02 | gmaxwell: | phantomcircuit: well, it was more obvious 20 years ago before the last N other env var surprises. |
23:15:04 | gwillen: | but they still pass remote input in variables |
23:15:05 | phantomcircuit: | i had always though openvpn was only passing well structure stuff to those scripts |
23:15:14 | gwillen: | yes, well-structured stuff |
23:15:19 | gwillen: | like the rdns of the remote host! :-P |
23:15:23 | gwillen: | guess who controls that? |
23:15:24 | phantomcircuit: | and find it hilarious that anybody considers cgi to be secure for production use at all |
23:15:31 | gwillen: | you will never ever ever get this all scrubbed |
23:15:55 | gwillen: | honestly, here's what I'd suggest if you want clean environments |
23:16:05 | gwillen: | have the kernel scrub the environment at every exec |
23:16:08 | gwillen: | with a whitelist |
23:16:12 | gwillen: | unless requested otherwise by a flag |
23:16:28 | phantomcircuit: | gwillen, the rdns of the remote host should only contain valid domain names |
23:16:31 | phantomcircuit: | which should be safe |
23:16:50 | gwillen: | gmaxwell: see what I mean? :-P |
23:16:55 | phantomcircuit: | that it's not indicates something is broken |
23:16:59 | gwillen: | you will be arguing with software authors about what's unsafe user input until the next century |
23:17:50 | gmaxwell: | phantomcircuit: even if it's not valid in DNS you can encode lots of crazy stuff and get it through. |
23:18:42 | phantomcircuit: | gmaxwell, right... but the value should be filtered by openvpn if it's not a valid dns name |
23:18:56 | gmaxwell: | maybe |
23:19:18 | gwillen: | so now we can agree that user input can't go in environment variables |
23:19:22 | gwillen: | we just can't agree on what user input is :-P |
23:20:01 | gwillen: | (Sorry I keep dropping off, my internet conection is shit) |
23:21:47 | phantomcircuit: | gwillen, in general user input -- even sanitized -- should not go into environment variables |
23:22:03 | gwillen: | phantomcircuit: you keep saying that but you want to put rdns into envrionment variables! :-P |
23:22:06 | gwillen: | that's sanitized user input! |
23:22:07 | phantomcircuit: | but the idea that unsanitized user input is going into them is just ridiculous |
23:22:18 | gwillen: | and not necessarily even sanitized very well! |
23:22:28 | phantomcircuit: | gwillen, no im saying i thought it was sanitized... not smart... but not nearly as stupid |
23:22:31 | gwillen: | I don't know if the protocol will stop me from returning "() {" in a dns label |
23:22:34 | gwillen: | but I bet you it won't! |
23:22:44 | gwillen: | at least not if I'm your local cache |
23:22:50 | gwillen: | maybe if I'm out on the internet somewhere |
23:22:56 | phantomcircuit: | gwillen, dns wont prevent that but openvpn should not be passing that |
23:24:37 | phantomcircuit: | gwillen, afaict the vast majority of modern linux systems aren't actually vulnerable to dhclient doing stupid things |
23:24:50 | phantomcircuit: | because they call a networkmanager binary which doesn't call anything else |
23:25:15 | gwillen: | my understanding is that networkmanager is not vulnerable, yes |
23:33:32 | gmaxwell: | ah, funny, even the monotone boolean functions are redundant for sane signing policies... in that they include functions that don't-care about some of the inputs. |
23:39:29 | sipa: | gmaxwell: would that make a significant difference? |
23:41:05 | sipa: | gmaxwell: i expect monotone_but_cares_about_all(n) = monotone(n) - n*monotone(n-1) or something |
23:41:47 | sipa: | ah, no |
23:42:00 | sipa: | monotone_but_cares_about_all(n) = monotone(n) - n*monotone_but_cares_about_all(n-1) |
23:42:52 | sipa: | mbcaa(1) = 1 |
23:43:46 | gmaxwell: | not really significant indeed. just I thought that monotone booleans mapped 1:1 to possibly sensible policies, but not quite. |
23:44:26 | sipa: | mbcaa(2) = 2 |
23:51:09 | gmaxwell: | mbcaa(3) = 9 (got tired of waiting and just counted them in my head!) |
23:51:32 | sipa: | yeah, i was trying to find a formula, but it doesn't seem quite right |
23:52:01 | gmaxwell: | 4 is too much to count or I'd just plug 1,2,9,x into OEIS and probably get the formula out. :) |
23:52:26 | gmaxwell: | 9 is quite a bit fewer than 20. |
23:52:32 | sipa: | uhu |
23:55:22 | kanzure: | oh what is OEIS? |
23:55:41 | gmaxwell: | online encyclopedia of integer sequences. |
23:55:51 | kanzure: | oh |
23:56:22 | gmaxwell: | my favorite use for it is when I have some problem where I can solve some consecutive values but don't see a closed form formula ... oeis knows it surprisingly often. |
23:56:25 | kanzure: | i would have guessed a competitor to eureqa (symbolic regression tool thing) |
23:56:58 | gmaxwell: | (and usually the result is some psycho thing from a totally unexpected field of analytic geometry or chess moves or something; but whatever) |
23:57:11 | andytoshi: | s/or/and/g |
23:57:43 | kanzure: | ouch looks like they took down all the open source versions of eureqa |
23:58:41 | kanzure: | http://web.archive.org/web/20120615103204/http://creativemachines.cornell.edu/eureqa |
23:59:31 | kanzure: | oh. it wasn't open source.. |