unicodeveloper / unicodeveloper/globalthreatmap

Detailed third-party error responses forwarded to the client

Open Beginner friendly
#36 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: Data Leakage / Vulnerability (Information Disclosure)
  • Severity: Medium

Evidence

// app/api/oauth/token/route.ts
const errorData = await tokenResponse.text();
console.error("Token exchange failed:", errorData);
return NextResponse.json(
  { error: "Token exchange failed", details: errorData },  // <-- raw upstream error
  { status: tokenResponse.status }
);
// app/api/valyu-proxy/route.ts
return NextResponse.json(
  { error: "proxy_error", message: errorData.message || "Request failed", details: errorData },
  { status: response.status }
);

Raw error bodies from Valyu's auth server and proxy are forwarded directly to the browser. These can include internal error codes, stack traces from Valyu's backend, or partial JWT information.

Affected files: app/api/oauth/token/route.ts, app/api/valyu-proxy/route.ts

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

Read app/api/oauth/token/route.ts and app/api/valyu-proxy/route.ts, focusing on how upstream error bodies are logged and returned through NextResponse. Confirm the existing status handling, then verify that client responses no longer expose raw Valyu error details, stack traces, or token information while retaining a useful safe error response.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, typescript
Domain
api, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.