We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab95754 commit 6f3ce02Copy full SHA for 6f3ce02
src/api/challenges/challenges.service.ts
@@ -61,7 +61,9 @@ export class ChallengesService {
61
) {}
62
63
async getChallenge(challengeId: string) {
64
- const requestUrl = `${TC_API_BASE}/challenges/${challengeId}`;
+ // Use the URL constructor to avoid path traversal/SSRF risks.
65
+ const baseUrl = TC_API_BASE.endsWith('/') ? TC_API_BASE.slice(0, -1) : TC_API_BASE;
66
+ const requestUrl = new URL(`/challenges/${challengeId}`, baseUrl).toString();
67
68
try {
69
const challenge = await this.m2MService.m2mFetch<Challenge>(requestUrl);
0 commit comments