Skip to content

Commit

Permalink
Merge pull request #395 from matrix-org/hs/auth-provisioner
Browse files Browse the repository at this point in the history
Require auth on provisioning endpoints
  • Loading branch information
Half-Shot authored Apr 17, 2020
2 parents 95470fa + d6a1b43 commit 340fabf
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 30 deletions.
1 change: 1 addition & 0 deletions changelog.d/395.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**SECURITY FIX** The bridge now requires authentication on the /_matrix/provision set of endpoints. It requires either an `access_token` query parameter or a `Authorization` header containing the `hs_token` provided in the registration file.
52 changes: 23 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"chai": "^4.2.0",
"escape-string-regexp": "^2.0.0",
"matrix-appservice": "^0.4.1",
"matrix-appservice-bridge": "^1.11.1",
"matrix-appservice-bridge": "^1.12.1",
"minimist": "^1.2.5",
"nedb": "^1.8.0",
"node-emoji": "^1.10.0",
Expand Down
1 change: 1 addition & 0 deletions src/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ export class Main {
handler: this.onHealth.bind(this.bridge),
method: "GET",
path: "/health",
checkToken: false,
});

const provisioningEnabled = this.config.provisioning?.enable;
Expand Down
1 change: 1 addition & 0 deletions src/Provisioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class Provisioner {
await this.handleProvisioningRequest(verb as Verbs, req, res);
},
method: "POST",
checkToken: true,
path: "/_matrix/provision/:verb",
});
}
Expand Down

0 comments on commit 340fabf

Please sign in to comment.