yossarian on Nostr: just had an interesting realization: one of the reasons people struggle to understand ...
just had an interesting realization: one of the reasons people struggle to understand template injection in GHA is probably because lines like this:
```
echo "hello: ${{ expr }}"
```
...get lexed mentally as "variable expansion, followed by Jinja template."
in other words, people think the `$` comes from the shell and the `{{ }}` is the template syntax, and therefore the entire thing is quoted correctly.
in reality of course the entire `${{ .. }}` is template syntax, and has nothing to do with shell quoting/expansion rules. but `$` is mentally overloaded!
i wonder how much easier this would be to teach people if GitHub had chosen `@{{ ... }}` or even just `{{ }}` as their template syntax instead.
#security #opensource
Published at
2024-12-16 19:05:05 UTCEvent JSON
{
"id": "129b1fa321f2363198b47fd14d7137993476423ffe8959dc26300c2194a132a6",
"pubkey": "c226f3bf8e9fa33c93edafe603f8fc769755773f0db685f0e6174ca96bf7c181",
"created_at": 1734375905,
"kind": 1,
"tags": [
[
"t",
"opensource"
],
[
"t",
"security"
],
[
"proxy",
"https://infosec.exchange/@yossarian/113664059321557015",
"web"
],
[
"proxy",
"https://infosec.exchange/users/yossarian/statuses/113664059321557015",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://infosec.exchange/users/yossarian/statuses/113664059321557015",
"pink.momostr"
],
[
"-"
]
],
"content": "just had an interesting realization: one of the reasons people struggle to understand template injection in GHA is probably because lines like this:\n\n```\necho \"hello: ${{ expr }}\"\n```\n\n...get lexed mentally as \"variable expansion, followed by Jinja template.\"\n\nin other words, people think the `$` comes from the shell and the `{{ }}` is the template syntax, and therefore the entire thing is quoted correctly.\n\nin reality of course the entire `${{ .. }}` is template syntax, and has nothing to do with shell quoting/expansion rules. but `$` is mentally overloaded!\n\ni wonder how much easier this would be to teach people if GitHub had chosen `@{{ ... }}` or even just `{{ }}` as their template syntax instead.\n\n#security #opensource",
"sig": "b39d85aee599507cc124da6e39d0cbd199ae0bf01d7f2856b9dccb42365933111b3d374abd026b98aef1831686f33888119b6e34dd6ebc65b222987361769c31"
}