Skip to content

Commit 06f3f95

Browse files
committed
Bug 2000514 - [HackerOne] Phabricator - Server-Side Request Forgery (SSRF) in Harbormaster “Make Request” Build Step
1 parent 1e405c4 commit 06f3f95

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,21 @@ public function execute(
5959

6060
$method = nonempty(idx($settings, 'method'), 'POST');
6161

62+
try {
63+
PhabricatorEnv::requireValidRemoteURIForFetch(
64+
$uri,
65+
array(
66+
'http',
67+
'https',
68+
));
69+
} catch (Exception $ex) {
70+
$this->logSilencedCall($build, $build_target, pht('HTTP Request: Invalid URI'));
71+
throw new HarbormasterBuildFailureException();
72+
}
73+
6274
$future = id(new HTTPSFuture($uri))
6375
->setMethod($method)
76+
->setFollowLocation(false)
6477
->setTimeout(60);
6578

6679
$content_type = $settings['content_type'];

0 commit comments

Comments
 (0)