unicodeveloper / unicodeveloper/globalthreatmap

IDOR on deep-research task results — no ownership check

Open
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.8k
Forks
300
PR merge metrics
No merged PRs in 30d

Description

  • Context: Cloud / Both
  • Category: Vulnerability (Insecure Direct Object Reference)
  • Severity: High

Evidence

The task-status route authenticates the caller but never verifies that the taskId belongs to the authenticated session:

// app/api/deepresearch/[taskId]/route.ts
export async function GET(request, { params }) {
  const { taskId } = await params;
  const accessToken = searchParams.get("accessToken");

  const selfHosted = isSelfHostedMode();
  if (!selfHosted && !accessToken) {
    return NextResponse.json({ error: "Authentication required" }, { status: 401 });
  }
  // ✅ Checks: is the user authenticated?
  // ❌ Missing: does this taskId belong to this user/session?
  const statusData = await getStatusViaProxy(taskId, accessToken);
  // statusData contains: generated content, sources, pdfUrl, deliverables
}

The response includes the full generated intelligence dossier, source list, PDF/PPTX download URLs, and CSV export data.

Scenario: User A starts a deep-research task; their taskId leaks via a server log, an APM trace, a Referer header (because taskId appears in the polling URL), or a shared log aggregator. Any other authenticated user who learns the taskId can retrieve the complete dossier without authorization.

If Valyu's backend enforces ownership on its side, this risk is partially mitigated — but the application provides no defense-in-depth layer, and any self-hosted-mode request (no auth required) bypasses even that.

Impact: Unauthorized read access to potentially sensitive intelligence dossiers generated by other users.

Affected files: app/api/deepresearch/[taskId]/route.ts, components/search/entity-search.tsx

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with app/api/deepresearch/[taskId]/route.ts and trace how task IDs are created, associated with sessions, and passed through getStatusViaProxy. Review components/search/entity-search.tsx for the polling flow. Done means an authenticated user cannot retrieve another user's task results, and the relevant self-hosted behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, typescript
Domain
api, authentication, authorization, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.