Skip to content

Conversation

@kkartunov
Copy link
Contributor

No description provided.

// Use the URL constructor to avoid path traversal/SSRF risks.
const baseUrl = TC_API_BASE.endsWith('/') ? TC_API_BASE.slice(0, -1) : TC_API_BASE;
const requestUrl = new URL(`/challenges/${challengeId}`, baseUrl).toString();
const requestUrl = `${TC_API_BASE}/challenges/${challengeId}`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The change from using the URL constructor to string concatenation for requestUrl reintroduces potential security risks such as path traversal or SSRF (Server-Side Request Forgery). Using the URL constructor helps mitigate these risks by ensuring proper URL parsing and construction. Consider reverting to the previous implementation using the URL constructor.

@kkartunov kkartunov merged commit 1d59e4e into master Nov 2, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants