Skip to content

Commit

Permalink
codeql suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
mgtennant committed May 21, 2024
1 parent b9ad9c9 commit 8f66c60
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/src/admin/admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,14 @@ export class AdminService {
async removeAdmin(username: string): Promise<{ error: string | null }> {
const ticdiAdminRole = 'ticdi_admin';
const bearerToken = await this.getToken();
const url = `${process.env.users_api_base_url}/integrations/${process.env.integration_id}/${process.env.css_environment}/users/${username}@idir/roles/${ticdiAdminRole}`;
try {
await axios
.delete(url, {
headers: { Authorization: 'Bearer ' + bearerToken },
})
.delete(
`${process.env.users_api_base_url}/integrations/${process.env.integration_id}/${process.env.css_environment}/users/${username}@idir/roles/${ticdiAdminRole}`,
{
headers: { Authorization: 'Bearer ' + bearerToken },
}
)

Check failure

Code scanning / CodeQL

Server-side request forgery Critical

The
URL
of this request depends on a
user-provided value
.
.then((res) => {
return res;
})
Expand Down

0 comments on commit 8f66c60

Please sign in to comment.