Repository navigation
Commit dcec288
fix(security): prevent SSRF in task-automation enterprise API calls (#3411)
Fixes CodeQL js/request-forgery (alert #116, critical). callEnterpriseApi
builds `new URL(endpoint, enterpriseApiUrl)` then fetches it; getAutomationRunStatus
interpolated a user-provided runId straight into the endpoint path
(`/api/tasks-automations/runs/${runId}`), so a crafted runId could inject
path segments into the request URL.
- Encode the user value in the path (encodeURIComponent(runId)).
- Add an origin allowlist guard in callEnterpriseApi: resolve the URL against
the configured enterprise API base and reject anything whose origin differs,
so no caller can redirect the request to another host.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 029e899 commit dcec288
1 file changed
Lines changed: 13 additions & 3 deletions
File tree
- apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/actions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| |||
243 | 251 | | |
244 | 252 | | |
245 | 253 | | |
246 | | - | |
247 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
248 | 258 | | |
249 | 259 | | |
250 | 260 | | |
| |||
0 commit comments