github / github/platform-samples

block_file_extensions.sh can be circumvented with fork + PR

Ouverte
#165 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Shell
Étoiles
2.2k
Forks
1.9k
Merge moyen
7 j 19 h
PR mergées (30 j)
1

Description

The `block_file_extensions.sh` pre-receive-hook can be circumvented by:

1. Fork the repository
2. Add a file with the blocked exension
3. Submit a pull request
4. Merge pull request

We've done a little research and suspect that this is due to the:
```
excludeExisting="--not --all"
```

I guess we could mitigate, e.g. by adding `block_self_merge_prs.sh`, but this could still be circumvented if 2 users with write privileges colluded.

Any thoughts?

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by reviewing block_file_extensions.sh, especially the excludeExisting="--not --all" behavior, and trace how forked pull requests are evaluated. The issue does not name a test or a concrete fix; done would require an agreed mitigation that prevents the reported bypass while addressing the stated collusion concern.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
shell
Domaine
security
Type d'issue
Bug
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.