HI version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
50% Positive
Analyzed from 557 words in the discussion.
Trending Topics
#github#actions#composer#red#php#gha#line#token#log#secret

Discussion (20 Comments)Read Original on HackerNews
This does not surprise me.
When the GH action YAML is just invoking shell scripts, I find it quite pleasant to use
How many other actions/libraries do you think are vulnerable?
> GitHub Actions' built-in secret masker matches registered values as exact substrings. When the exception message is rendered by Symfony Console it may wrap, embed in In BaseIO.php line N: framing, or interleave with ANSI control sequences. So the masker does not redact, and the plaintext token reaches the log.
What does this log rendering look like such that the token from that code snippet becomes interleaved enough to not be a substring match?
I'm not familiar with composer/Symfony but I would expect something like:
For your example:
Line 34: <red>ghs_fdsafdsarewqfdsa...</red>
Is probably long enough in most cases to break to a new line.
Also, those blocks get "interleaved" like this:
<red>ghs_fdsafdsarewqfdsafdsa</red>
<red>fdsardsardsafdsafs......</red>
So there are now </red>'s within the token, also breaking the substring matching.
This is kind of eye-opening for me -- I have never thought about how styled output like this could cause logging leakages.
This include's the GITHUB_TOKEN that is builtin within a actions jobs.
It's not an issue in GHA itself, this time. But if you are a composer user in GH, you should definitely be warned (and worried).