consider never using `sandbox.preserve_env`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 412
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 3
Description
Currently, cms passes all env variables from the host into compiler and checker invocations. This seems quite unnecessary to me, and AFAIK is not mentioned in the manual. It is relatively common to pass api tokens or whatnot in environment variables, so server admins may unwittingly expose sensitive information in it (even though CMS itself doesn't use env vars for this).
All language compilers should work fine without any extra env vars (in #1545 i disabled preserve_env and only had to add PATH manually). I can't think of any reason to pass extra env vars to checkers (if you want to give it extra information, you can just hardcode it into the checker binary or something). Hence I propose disabling preserve_env for both compilation and checker runs.
Contributor guide
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
Locate the compiler and checker invocation paths that use sandbox.preserve_env, then inspect how PATH is supplied when host environment inheritance is disabled. Done means compiler and checker runs no longer receive unrelated host environment variables while still retaining the PATH they need; add or update focused tests if the surrounding code provides them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100