Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

OAuth authorization code is delivered to www.egnyte.com, where it can be logged

未关闭
#3 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
javascript

调研方向

从 src/commands/auth.js 开始,包括 DEFAULT_CLIENT_SECRET 以及授权和令牌交换流程。与维护者确认 PKCE、专用回调还是环回重定向是预期的解决方案;完成的标准是授权码不会暴露给营销网站的日志记录或分析功能,并且登录流程仍能安全完成。

由索引模型根据 Issue 内容生成。

描述

Summary

egnyte login uses a default redirect_uri of https://www.egnyte.com, so the OAuth authorization code is returned as a query parameter to the public marketing site. An authorization code is a credential, and delivering it in a URL to that site exposes it to logging and tracking unrelated to the login.

Where the code goes

After approval the browser lands on:

https://www.egnyte.com/?code=<authorization_code>&state=<state>

That URL, including the code, is exposed to:

  • Web server and CDN access logs. Query strings are recorded by default in common server and proxy configurations.
  • Client-side analytics. www.egnyte.com loads Google Tag Manager, and a standard page-view tag reports the full page location, including the query string, to the configured analytics endpoints.
  • Browser history, and the Referer header on any third-party request the page makes.

Why this is exploitable, not only untidy

The CLI is a public client. Its client secret ships in the published npm package (DEFAULT_CLIENT_SECRET in src/commands/auth.js), and the authorize request does not use PKCE. The packaged secret is therefore not secret, and nothing else binds the code to the client that requested it. A code recovered from any surface above can be exchanged for a token by anyone who holds it together with the packaged secret. Single use does not close the gap: an abandoned login leaves the code unspent until it expires, and the log and analytics capture happen immediately whether or not the CLI completes the exchange.

To be precise, it is the authorization code in the query string, not the access token; the token is obtained later by a POST to /puboauth/token. The code is still a credential that yields a token.

Suggested remediation, most to least contained

  1. Add PKCE (code_challenge on the authorize request, code_verifier on the token exchange). A captured code is then useless without the verifier, even if the current redirect and paste flow are kept. This also removes the need to ship a client secret.
  2. If PKCE is not adopted, move the redirect off the analytics-instrumented marketing page to a dedicated callback that does not load tag managers and does not log the query string.
  3. Use a loopback redirect (http://127.0.0.1:<port>) so the CLI reads the code directly and it never appears in a browser-visited URL. This also removes the manual copy-paste step.

I can open a PR for the PKCE change if that is the direction you prefer.

Related

The generated state value is not verified on return, since the CLI reads only the pasted code. That is minor on its own and would be resolved by a loopback redirect.

主要语言
JavaScript
星标
5
派生
2
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。