Skip to content

Remediate legacy Uber API dependencies - #2

Draft
rogerin wants to merge 2 commits into
masterfrom
security/uberhackapi-dependency-remediation-20261117
Draft

rogerin wants to merge 2 commits into
masterfrom
security/uberhackapi-dependency-remediation-20261117

Conversation

@rogerin

@rogerin rogerin commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Security changes

  • Replace old Axios and Express releases, remove node-uber and its legacy transitive chain, regenerate the lockfile, and stop versioning 1,744 node_modules files.
  • Move embedded credentials to environment configuration. Previously committed Uber credentials and a Google Maps key remain in Git history and require provider-side rotation; this PR does not revoke them or rewrite history.
  • Harden both HTTP entry points (app.js and horadeir.js): generate unpredictable browser-bound OAuth state, expire it after 10 minutes, consume it before token exchange, rotate an HttpOnly/SameSite cookie on success, and keep access tokens only in server-side per-browser sessions.
  • Require a valid session for every Uber proxy route, omit access and refresh tokens from callback responses, stop logging personal Uber response bodies, and mark authenticated responses no-store. Keep horadeir.js's environment token separate for background price polling.
  • Bind development servers to loopback by default and document HTTPS and session-store requirements for remote deployment.

Verification

  • Compared all 85 currently open Dependabot alerts with the new lockfile; affected packages are absent or above the listed patched floors. npm ci, npm ls --all, and online npm audit --audit-level=low (zero findings) passed.
  • Baseline mocked requests reproduced a callback returning tokens without login and a second client using the first client's bearer. Updated tests passed 6/6 across both servers: separate clients, missing/wrong/cross-client/replayed/expired state, single use during an asynchronous exchange, failure cleanup, anonymous routes returning 401, and token-free callback bodies.
  • A review found anonymous pending-session saturation. Pending and authorized stores are now separate and bounded; the oldest pending state is evicted. A 1,025-login control confirms new logins continue and existing authorized sessions survive.
  • JavaScript syntax, diff checks, and token-only CLI startup without OAuth client credentials passed. Independent read-only review found no further concrete bypass or regression.

Review notes

This remains a draft and does not merge or deploy. Sessions are in process memory; a remote multiworker deployment needs shared server-side storage, HTTPS, and operational rate limiting. No live Uber integration test or external credential rotation was performed. GitHub will reassess default-branch alerts after merge and reindexing.

@rogerin

rogerin commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner Author

Validação atualizada após o commit 798fe4e: os 85 alertas de dependência foram comparados ao lockfile e a auditoria npm online retornou zero. Os dois servidores agora exigem state OAuth de uso único vinculado ao navegador, mantêm tokens somente em sessões no servidor, isolam clientes e protegem todas as rotas Uber; o monitor conserva seu token separado. O caso antigo de callback sem login e vazamento entre clientes foi reproduzido, e 6/6 testes passaram após a correção. Revisão independente identificou saturação anônima de estados pendentes; ela foi corrigida e retestada. Credenciais históricas precisam de rotação no provedor; sessões em memória exigem armazenamento compartilhado, HTTPS e limite operacional antes de uso remoto.

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.

1 participant