unity-gateway: OAuth JWT written world-readable (0644) by ug configure

Open
#1,544 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
cli, security

Research direction

Start by tracing how ug configure --user --agents opencode writes ~/.ucode/opencode-xdg/opencode/opencode.json, ucode-auth.js, and state.json, and compare their permissions with managed-config.json. Reproduce the setup and check the resulting file and directory modes; done means the live token is not readable by other local users, with the chosen approach consistent across these files.

Written by the indexing model from the issue text.

Description

ug configure --user --agents opencode (v0.2.1) writes the live OAuth access token (client_id databricks-cli, about 1 hour remaining) into ~/.ucode/opencode-xdg/opencode/opencode.json as both options.apiKey and options.headers.Authorization.

The file has mode -rw-r--r--, so any local user can read it, and ucode-auth.js and state.json are also 0644. managed-config.json is correctly 0600. Suggested fix: create these files with mode 0600 and the directory with 0700, or avoid writing the token and rely on the refresh plugin. Checked on macOS arm64, v0.2.1.

Dominant language
Python
Stars
122
Forks
101
Avg merge
1d 16h
Merged PRs (30d)
198

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

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 databricks/unity-gateway

All issues in databricks/unity-gateway

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.