Another quality Security update from Phabricator! 馃悤
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Jan 5 2018
Mostly from the HN thread, other possible providers we haven't tried yet include Mandrill, Postmark, and Sparkpost.
T12677 documents previous general issues with mail providers. Mailgun gets the worst of it there, but just because we've been with them for a while without anything too awful happening.
Jan 4 2018
Dec 26 2017
Dec 18 2017
Adjacently, some other parts of the UI currently use the word "enormous" (see https://discourse.phabricator-community.org/t/herald-enormous-check/822). They should be rewritten to use different language (like "Very Large"). We should use the term "Enormous" to mean only "too large to process completely", while the other UI uses it to mean "large enough to partially collapse for viewer convenience".
Nov 28 2017
Thank you very much!
I fumbled the task ID in D18793, but this should be resolved by that change.
Nov 21 2017
That's a good point! I wish it was designed like that since the beginning. I guess it won't happen with the current compatibility rules since it is likely to break automation.
In theory, you could require --config appear between hg and foo in hg foo .... This is already a valid position for --config (for example, hg --config x=y foo is valid), and already not a valid position for foo flags (for example, hg --branch default log is not valid).
https://phab.mercurial-scm.org/D1483 should make it possible to use -- to defend against non-flag user input. For inputs that are flags, use the form --flag=X and avoid --flag X.
Nov 13 2017
We'll use the hardened mode once it's available, but I don't think we expect to take any further action here until then.
Nov 10 2017
This is now in master so I've made the task public.
I don't want to leave RCE in Phabricator for 3 weeks, so I'm planning to land, deploy and disclose some version of the patch above today.
(I change visibility for this to @epriestley, @amckinley and @durin42 for now -- note that I intend to eventually make this issue public once the fix hits the commit log, so don't stockpile all your 0-days here.)
Oct 3 2017
Not a problem - thanks for fixing that so quickly.
I can confirm that fixed the issue for us.
Oct 2 2017
Sep 30 2017
(I'll fix this if you don't get there first, but have used up all my brain energy for today. And thanks for the report!)
Would it be acceptable to change PhutilRemarkupHyperlinkRule to catch this exception and behave as if it were a non-whitelisted protocol? (Happy to draft the patch, just want to check before I do so)
This change creates a slight problem for us at KDE as we have some historical commits in our Subversion repository which have URLs in them which are invalid. This exception means that:
- Herald spins forever trying to process these commits, failing every single time (currently up to 855 failures).
- The commit can't be viewed in the browser (See https://phabricator.kde.org/R883:271607)
Sep 29 2017
Aug 22 2017
Aug 14 2017
There doesn't seem to be anything actionable remaining on our end.
Aug 12 2017
In https://hackerone.com/reports/259246 (not currently disclosed) a researcher found an actual issue with figlet. Although it would probably be hard to develop into a practical attack, it does make me feel better about the decision to pull all this stuff into PHP (not just dot) when the dot issue was originally identified.
Aug 11 2017
This cropped up in the HN thread -- works in my browsers (although Phabricator does not recognize it as a valid link):
Thanks for the writeup :)
The reason the upstream projects aren't using -- is that it isn't portable. For example, Putty's ssh doesn't support it.
The full set of mitigations is now available in stable, and I've promoted 2017 Week 32 (Mid August).
See also this enormously valuable contribution I made to the Git LFS upstream in connection with T7789 some time ago:
In T12961#230931, @avivey wrote:So, all three major VCS had the exact same CVE, which was "we invoke ssh command line, don't sanitize input, and don't specify -- anywhere"?
Thanks for the detailed explanations! I should have thought more carefully. Note old Mercurial also fails to do correct shell quoting on Windows (It uses ' where Windows needs "). But Phabricator does not run on Windows, it shouldn't be an issue.
So, all three major VCS had the exact same CVE, which was "we invoke ssh command line, don't sanitize input, and don't specify -- anywhere"?
@indygreg Thanks for the heads up about subrepos -- I would not have otherwise guessed that hg pull might run git.
From this writeup:
The magic incantation I arrived at was slightly modified from one of the hg test cases:
Never mind, I was able to get hg pull -u to interact. I'm going to land, cherry-pick, and hotfix D18390.
I think this is related:
https://www.mercurial-scm.org/wiki/Subrepository#Synchronizing_in_subrepositories
And here's an extension which appears to be aimed at solving this problem, by adding a new command to execute hg pull -u in subrepositories:
Also, although ui.ssh appears inneffective against the [git] and [svn] variants of subrepos (Mercurial does not appear to populate GIT_SSH or SVN_SSH based on the ui.ssh setting), I can't get hg to actually interact with remotes using hg clone --noupdate ... or hg pull -u -- <uri>, which are the only relevant commands we run. I can get it to interact with remotes with hg up or hg clone (without --noupdate).
In the example above, I put malicious content in .hgsub, like this:
The subrepo issue is when .hgsub has malicious content (ex. foo = ssh://-oProxyCommand=touch%20BAR/). It's not related to command line or config files.
I'm going to cherry-pick rP794e185bf90e (the SSH wrapper stuff) to stable and hotfix production, although I'm not entirely certain hg pull -u -- <uri> is vulnerable.
I also can't get hg pull -u -- <uri> to fetch subrepos, am I just not setting things up correctly? In my current working state, hg up tries to interact with the subrepo remote but hg pull -u -- <uri> (which is what we actually execute) does not.
See also T4416. Removing -u hasn't been a priority because no actual install has expressed interest in it.
Aug 10 2017
That same code I pointed to for Mercurial also seems to perform Git working copy checkouts. Although I can't recall Git's semantics for automatically updating submodules (because I don't use them). It is worth auditing.
Note that Phabricator can manifest Mercurial working directories. See executeMercurialUpdate() in src/applications/repository/engine/PhabricatorRepositoryPullEngine.php. It does this when pulling non-hosted repos. I know this occurs when observing repos. Not sure where else this code is used.
I'll leave this open until I write up the release notes since it deserves a mention (users are still vulnerable if an attacker tricks them into running a suspicious git clone command), but I think we're otherwise unscathed by this.
We also used to have a separate PhutilGitURI which had looser rules, but I removed this in D16100 (June 13, 2016) and all URI parsing now goes through PhutilURI which has the stricter rules.
The theoretical attack here is:
These are slightly more fleshed-out versions of the attack in Mercurial:
git, svn, and hg... wow
The attack is basically:
oh wow
Jul 27 2017
We appear to have survived this.
Jul 9 2017
Jun 28 2017
The "consulting firms" use case is explicitly disavowed by, e.g., the Spaces documentation, here:
I can't think of any solution to this short of full policy + complex policy rules such as "users that share project/space/payment account/instance with this user", which is complex (and probably slow to compute, or requires lots of extra stuff to maintain).
If we put spaces on user accounts, how do I get into a Space you have permission to see so you can add me as a Manager on the payment account for phacility.phacility.com in Phortune using the typeahead?
Spaces for user accounts?
Jun 27 2017
This is fundamentally unfixable
This is fundamentally unfixable:
Jun 6 2017
It doesn't try to run evil.exe until I edit the cell (the csv version, and the modified xlsx I saved myself try to start on opening).
Here's a version with =cmd|'/C evil.exe'!A0 if that produces different results:
Actually, Excel 2016 is vulnerable. The test case is incomplete. The cell needs to be =cmd|'/C evil.exe'!A0 to trigger the issue.
By modifying the value in both the xlsx and csv files, I was able to blindly click yes on lots of warning prompts and start calc.exe. But I am not sure that modifying the value in the xlsx file is giving the same result as the export would (something may have been stripped off in the meantime...)
It seems an up to date patched Excel 2016 is not vulnerable.
Saving this file as csv also doesn't trigger the bug in Excel 2016 - on reopening, Excel misdetects the format as SYLK, warns about the extension not matching, then warns that an error occured during loading, and finally when you agree to continue loading as "a different format", it opens without running calc.exe or prompting to update cells.
Jun 5 2017
Good to hear, thanks!
Checked on Excel 2016 and it didn't run calc.exe or prompt for "update cells". Also checked on Excel for mac~
If anyone actually has bona fide Excel.exe installed, you could try opening this file to double check that we're not currently vulnerable:
May 12 2017
T11632 is vaguely related.
Apr 13 2017
(And I think "Conpherence as an announcement tool" is a very marginal use case anyway -- today, Phame is probably better already?)
That seems reasonable to me. We could implement a "read-only" equivalent later by having a flag like "require edit permission to send messages to this room" if we need it. That probably makes more sense anyway -- I can't really think of any use cases where a room is sort-of read-only, but the users who can post to it are different than users who can edit it.