abcxyz / abcxyz/tagrep

Writing arbitary env vars is dangerous

Aperta
#44 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Go
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### TL;DR

The first example showing writing arbitrary tags from a PR description is a signficant security vulnerability, as it introduces a backdoor for arbitary code execution in CI/CD pipelines.

https://github.com/abcxyz/tagrep#github---exporting-tags-as-environment-variables

A maliciously crafted env var can allow an attacker to force code to run.

Things like NODE_OPTIONS, LD_PRELOAD, or PYTHONPATH could be used to load malicious code. Note the risk is somewhat decreased with proper human review before approving CI/CD runs, but there is a TOCTOU issue.

### Expected behavior

If env vars were prepended with a set prefix by default, most of this risk could be mitigated. There should be a more secure pattern demonstrated in the readme.

### Observed behavior

_No response_

### Environment Details

```markdown
N/A
```

### Additional information

_No response_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.