OAuth authorization code is delivered to www.egnyte.com, where it can be logged
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript
- 领域
- authentication, cli, security
调研方向
从 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.comloads 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
Refererheader 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
- Add PKCE (
code_challengeon the authorize request,code_verifieron 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. - 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.
- 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,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
FEATURE REQUEST
难度 2/5 1-3 小时 新手友好度 68/100
linuxmint/cinnamon-spices-extensions#1193 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
Fei2411/DeepSeek-Bot#703 ·
-
area:web first-timers-only good first issue
难度 1/5 1 小时以内 新手友好度 95/100
career-ops-hq/career-ops#6264 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 83/100
cline/mcp-marketplace#3394 ·
-
bug
难度 2/5 1-3 小时 新手友好度 77/100
exelearning/exelearning#2677 ·
维护者通常 1 天内回复