systemd user unit interpolates the install path without rejecting control characters
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 94
- Forks
- 16
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 5
Description
Summary
scripts/install-systemd-user writes user units with:
WorkingDirectory=$UNIT_ROOT
ExecStart="$PYTHON_BIN" "$ROOT/meter.py"
UNIT_ROOT only substitutes spaces (${ROOT// /\x20}). Newlines, quotes, or backslashes in the clone path can break out of the unit file.
This is user-controlled (you pick the clone directory), not remote injection. Still worth rejecting control characters and quotes in ROOT before interpolating, or generating the unit with a language that escapes systemd strings.
atomic_write_text() in token_meter/app.py also leaves new files at the process umask instead of 0600. The Git-delivery SQLite salt lives under ~/.token-meter/.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with scripts/install-systemd-user and trace how ROOT becomes UNIT_ROOT and the generated unit text. Then inspect atomic_write_text() in token_meter/app.py, using paths containing newlines, quotes, or backslashes as inputs. Done means unsafe paths are rejected or safely escaped before interpolation, and newly created files use 0600 permissions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, shell
- Domain
- devops, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100