[BUG]: GitHub Personal Access Token (PAT) is stored in plaintext in localStorage

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

维护者通常 1 天内回复

@Sandeepkg123 已经在做这个了。

开始于 2026年11月3日。

  • #442 来自 @Sandeepkg123 —— 未关闭
  • #445 来自 @Basharkhan7776 —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
github, javascript

调研方向

Start by reading the token save and load paths in src/context/AppContext.jsx, the GitHub request in src/services/github.js, and the Settings disclosure in src/pages/SettingsPage.jsx. Determine what protection is feasible for a static browser app and how it affects token use. Done means the token exposure and the mismatch in the Settings explanation are addressed; the issue does not specify a proposed design or tests.

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

描述

bug
Bug Description

The app stores the user's GitHub Personal Access Token (PAT) in plaintext in the browser's localStorage under the key oe_pat. It is not encrypted and not hashed (no bcrypt, no WebCrypto, no AES). Anyone with access to the browser profile, DevTools, or an XSS vulnerability can read the full token and use it to access the user's GitHub account with the token's scopes.

Relevant code:

  • Save (plaintext write): src/context/AppContext.jsx:144 → localStorage.setItem('oe_pat', token)
  • Load (plaintext read): src/context/AppContext.jsx:29 → localStorage.getItem('oe_pat')
  • Delete: src/context/AppContext.jsx:156
  • Token is also sent as-is to GitHub: src/services/github.js:85 → headers.Authorization = \token ${pat}``

The Settings page tells users "Your Personal Access Token (PAT) is stored locally on your device and is never sent to any server" (src/pages/SettingsPage.jsx:143), but does not disclose that it is stored unencrypted and readable by any script on the origin.

Steps to Reproduce
  1. Open the app and go to Settings.
  2. Paste a valid GitHub Personal Access Token and click Save (token is validated against https://api.github.com/rate_limit).
  3. Open DevTools (F12 / Ctrl+Shift+I / Cmd+Option+I) → Application tab → Storage → Local Storage → select the app origin.
  4. Observe the key oe_pat.
  5. Copy the value — it is the full, readable PAT.
  6. Alternatively, in DevTools → Console, run:
    localStorage.getItem('oe_pat')
    The raw token is returned in plaintext.
    
    
Logs and Screenshots

The token can be seen in the browser inspection menu:
Image

Console proof:
Image

Environment Details
  • Browser: Brave Browser (latest stable)
  • OS: Linux
  • App version: v1.0.0
  • Build: Production static build (GitHub Pages)
  • Storage: Browser localStorage
Impact

Critical - Application is unusable

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
主要语言
JavaScript
星标
53
派生
182
平均合并
18 分钟
30 天内合并 PR
2

环境准备

从这里开始

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

AOSSIE-Org/OrgExplorer 的其他 Issue

查看 AOSSIE-Org/OrgExplorer 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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