HomePhabricator

Hide "notification.servers" configuration and don't follow redirects from…

Description

Hide "notification.servers" configuration and don't follow redirects from Aphlict

Summary:
See https://hackerone.com/reports/850114.

An attacker with administrator privileges can configure "notification.servers" to connect to internal services, either directly or with chosen parameters by selecting an attacker-controlled service and having it issue a "Location" redirect.

Generally, we allow this attack to occur. The same administrator can use an authentication provider or a VCS repository to perform the same attack, and we can't reasonably harden these workflows without breaking things that users expect to be able to do.

There's no reason this particular variation of the attack needs to be allowable, though, and the current behavior isn't consistent with how other similar things work.

  • Hide the "notification.servers" configuration, which also locks it. This is similar to other modern service/server configuration.
  • Don't follow redirects on these requests. Aphlict should never issue a "Location" header, so if we encounter one something is misconfigured. Declining to follow this header likely makes the issue easier to debug.

Test Plan:

  • Viewed configuration in web UI.
  • Configured a server that "Location: ..." redirects, got a followed redirect before and a failure afterward.

Screen Shot 2020-04-15 at 6.46.58 AM.png (277×922 px, 32 KB)

Differential Revision: https://secure.phabricator.com/D21123