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

Open
#421 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Sandeepkg123 is already working on this.

Since Nov 3, 2026.

  • #442 by @Sandeepkg123 — open
  • #445 by @Basharkhan7776 — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
github, javascript

Research direction

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.

Written by the indexing model from the issue text.

Description

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
Dominant language
JavaScript
Stars
53
Forks
187
Avg merge
18m
Merged PRs (30d)
2

Getting set up

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.

More from AOSSIE-Org/OrgExplorer

All issues in AOSSIE-Org/OrgExplorer

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.