News for hackers. Stuff that matters.
Re:Critical security updates for Git, Subversion and Mercurial by jjnoakes on Friday August 11, 2017 @09:25AM (#14989390)
It's interesting to me that the fix was pattern matching the ssh hostname and banning a starting hyphen, rather than (say) passing "--" to ssh to signal the end of the intentional options so a hostname of "-oProxyCommand=whatever" is interpreted by ssh properly (as a hostname which can't be reached, instead of as a rogue argument).

I thought this was a fairly well known way to pass arbitrary strings to commands and ensure they aren't interpreted as options (for commands which honor "--", like ssh does).

Re:Critical security updates for Git, Subversion and Mercurial by peff on Friday August 11, 2017 @09:47AM (#14989578)
We discussed that, but it wasn't clear that doing so was portable. It works for OpenSSH. It doesn't for PuTTY. We don't know what other implementations people might have as `ssh` on their systems.
Re:Critical security updates for Git, Subversion and Mercurial by peterwwillis on Friday August 11, 2017 @12:16PM (#14991343)
It seems a little risky to assume separate clients/platforms will always interpret command line arguments the same way. At some point when a client breaks compatibility you have to implement methods to support the one-offs, or drop support. So for portability's sake, why not start writing those methods now, and have a generic universal method to fall back on for untested clients/versions?

Or is that really unnecessary?

Re:Critical security updates for Git, Subversion and Mercurial by avar on Friday August 11, 2017 @02:23PM (#14992757)
How would a program like git figure out what flavor of "ssh" program is on the system? Keep in mind that it may change while a long-running git command is running.
Re:Critical security updates for Git, Subversion and Mercurial by pwdisswordfish on Friday August 11, 2017 @12:24PM (#14991430)
Dropbear[0] doesn't seem to support "--" either.

[0] https://matt.ucc.asn.au/dropbear/dropbear.html

Re:Critical security updates for Git, Subversion and Mercurial by luckydude on Friday August 11, 2017 @12:25PM (#14991448)
What happens if you do the -- fix and then use PuTTY? If it just fails then I'd argue that's OK, PuTTY will get updated as a result of the failure, no?
Re:Critical security updates for Git, Subversion and Mercurial by pwdisswordfish on Friday August 11, 2017 @12:38PM (#14991611)
Why do you think Lennart Poettering is hated so much?
Re:Critical security updates for Git, Subversion and Mercurial by gazarsgo on Friday August 11, 2017 @12:58PM (#14991889)
+100000

Someone needs to teach the next generation about ABI compatibility...

Re:Critical security updates for Git, Subversion and Mercurial by pwdisswordfish on Friday August 11, 2017 @09:50AM (#14989608)
Ordinarily I'd agree, but a starting hyphen isn't valid in a domain name anyway, so it's harmless. RFC 1035: "The labels [a grammar production rule for domain names] must follow the rules for ARPANET host names. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen. There are also some restrictions on the length. Labels must be 63 characters or less."

(And by the way, neither is a leading dot, which I use to my advantage to define hostname aliases in ~/.ssh/config which I can be sure will never clash with anything.)

Re:Critical security updates for Git, Subversion and Mercurial by LukeShu on Friday August 11, 2017 @10:00AM (#14989716)
> They must start with a letter

By the RFCs, that's true; but if you think it's true in practice, then 4chan.org would like a word with you.

Re:Critical security updates for Git, Subversion and Mercurial by pwdisswordfish on Friday August 11, 2017 @10:17AM (#14989856)
Right... but the no-starting-hyphen rule seems to be more universally accepted.

...

...Oh, fuck me. I just found https://archive.fo/T0WcV ... (archive.is link because Firefox won't open it directly)

Re:Critical security updates for Git, Subversion and Mercurial by geofft on Friday August 11, 2017 @10:44AM (#14990126)
I think it's not so much Firefox as your OS - if you're on a GNU platform, glibc will refuse to resolve a hostname that starts with a hyphen (it won't even attempt the resolution), but macOS's libc resolver is totally fine with it. I forget what Windows does.
Re:Critical security updates for Git, Subversion and Mercurial by danarmak on Friday August 11, 2017 @11:05AM (#14990362)
Chrome and Firefox on Windows 10 both open http://-emmawatson.tumblr.com/ without trouble.
Re:Critical security updates for Git, Subversion and Mercurial by Klathmon on Friday August 11, 2017 @11:40AM (#14990758)
My chrome will not open that website (gives a DNS resolution error).

Chrome: 61.0.3163.31 (Official Build) beta (64-bit) Windows: Microsoft Windows 10 Pro 10.0.15063 Build 15063

My DNS is pointed at my router which is forwarding requests to Google's 8.8.8.8 DNS servers.

Re:Critical security updates for Git, Subversion and Mercurial by Godel_unicode on Friday August 11, 2017 @11:39AM (#14990749)
Doesn't work on chrome for Android, DNS error.
Re:Critical security updates for Git, Subversion and Mercurial by js2 on Friday August 11, 2017 @12:49PM (#14991756)
Decade old glibc issue:

gethostbyname() cant resolve names starting/ending with "-"

https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/144431

Re:Critical security updates for Git, Subversion and Mercurial by gazarsgo on Friday August 11, 2017 @06:08PM (#14994758)
I ran across this a couple years ago because Tumblr let you use a leading - for your subdomain... I remember being so shocked reading this thread, but clearly nobody on that discussion had heard of Tumblr at the time. Very surreal.
Re:Critical security updates for Git, Subversion and Mercurial by frandroid on Friday August 11, 2017 @11:15AM (#14990489)
Huh? I just opened it in Firefox Nightly...
Re:Critical security updates for Git, Subversion and Mercurial by geofft on Friday August 11, 2017 @10:43AM (#14990115)
https://tools.ietf.org/html/rfc1123#page-13

      The syntax of a legal Internet host name was specified in RFC-952
      [DNS:4].  One aspect of host name syntax is hereby changed: the
      restriction on the first character is relaxed to allow either a
      letter or a digit.  Host software MUST support this more liberal
      syntax.
Re:Critical security updates for Git, Subversion and Mercurial by bostik on Friday August 11, 2017 @03:47PM (#14993468)
Hmm.. that's from 1989. 3Com would have still been a fairly respected network hardware vendor.

I have a strange feeling '3com.com' would have been a consideration when this change was proposed.

Re:Critical security updates for Git, Subversion and Mercurial by MikeTLive on Friday August 11, 2017 @12:11PM (#14991249)
doesn't say it must not accept anything other than a letter or a digit and so, to cover future leniency changes, i would not be surprised to see poetic-license taken such that they allow damn near anything in an unreliable way.