cms-dev / cms-dev/cms

consider never using `sandbox.preserve_env`

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

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

Open the 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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.