Skip to content

GitHub Action: make fix-all (v6) security#8106

Closed
Alkarex wants to merge 1 commit intoFreshRSS:edgefrom
Alkarex:security-github-action-commands
Closed

GitHub Action: make fix-all (v6) security#8106
Alkarex wants to merge 1 commit intoFreshRSS:edgefrom
Alkarex:security-github-action-commands

Conversation

@Alkarex
Copy link
Member

@Alkarex Alkarex commented Oct 13, 2025

Supplement for #8100
Follow-up of #8098

@Alkarex Alkarex added this to the 1.28.0 milestone Oct 13, 2025
@Alkarex Alkarex added the System care Everything related to system care label Oct 13, 2025
@Inverle
Copy link
Member

Inverle commented Oct 15, 2025

Not secure

See PoC: https://github.com/Inverle/gha-testing/pull/2

Reasons:

  1. contents: read wouldn't work, meaning you have to downgrade security by setting contents: write instead (there isn't a permission for allowing writing only to a PR)
  2. github-script isn't safer than calling a bash script, because it's just a node process with a INPUT_GITHUB-TOKEN environment variable passed which contains the GITHUB_TOKEN
    specifically: /home/runner/actions-runner/cached/externals/node24/bin/node /home/runner/work/_actions/actions/github-script/v8/dist/index.js
  3. and other steps are also just another bash/node process in the context of the runner user which can read each others environment variables via /proc/XXX/environ

https://github.com/actions/github-script/blob/ed597411d8f924073f98dfc5c65a23a2325f34cd/action.yml#L13
https://github.com/actions/github-script/blob/ed597411d8f924073f98dfc5c65a23a2325f34cd/action.yml#L38-L40

Get PR details and security doesn't seem to be improving security either,

@Inverle
Copy link
Member

Inverle commented Oct 15, 2025

There are probably 2 approaches for doing this safely then:

  • Restricting the command only to owners and members of the repo (and checking PR contents before running the command) - easier
  • Running the checkout step and make fix-all command in a container then copying the changed files over back to the host, then making a commit (still hard to get this right, not sure if possible)

@Alkarex
Copy link
Member Author

Alkarex commented Oct 15, 2025

I was hopping to be able to find the right permissions to have something simpler, but maybe a GitHub Bot would actually be needed

Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Oct 15, 2025
@Inverle
Copy link
Member

Inverle commented Oct 15, 2025

but maybe a GitHub Bot would actually be needed

this way?
https://docs.github.com/en/apps/creating-github-apps

@Alkarex
Copy link
Member Author

Alkarex commented Oct 15, 2025

Yes, a bit like Dependabot

@Frenzie
Copy link
Member

Frenzie commented Oct 15, 2025

I don't know, just as a user isn't it nicer to double check the automated changes before committing? Or do people completely ignore GH sending emails saying the action failed?

@Frenzie
Copy link
Member

Frenzie commented Oct 15, 2025

Also there's a big risk it'd cause me conflicts. I have to say I'm not fond of some annoying automated bot or action at all really, but maybe that's just me.

@Alkarex
Copy link
Member Author

Alkarex commented Oct 15, 2025

The idea would still be to react on /fix-all, not to be automatic.
For users using the edit button of the Web interface to translate something of propose a fix, having to run something locally is an order of magnitude more challenging. We offer a Dev Container in the Web browser, but that is still more complicated than fixing things directly from the comment thread.

We could also reconsider how this readme with i18n is working, as it creates almost systematic merge conflicts and test failures.

@Frenzie
Copy link
Member

Frenzie commented Oct 15, 2025

For that specifically I'd just update it automatically after a commit on edge, triggered by having touched a file in the translations folder.

@Frenzie
Copy link
Member

Frenzie commented Oct 15, 2025

Although that could result in many more commits, so possibly never mind.

Alkarex added a commit that referenced this pull request Oct 16, 2025
@Frenzie
Copy link
Member

Frenzie commented Oct 16, 2025

For that specifically I'd just update it automatically after a commit on edge, triggered by having touched a file in the translations folder.

So to refine that idea, a "cron" job[1] that runs every three days or less that checks for example git log -1 --format="%ct" -- app/i18n/ vs the README. Or maybe something even simpler would suffice. It doesn't matter, the point is that if app/i18n/ is newer than README.md, update the README with the new status (IF it actually results in a file change of course).

[1] It uses the same syntax anyway.

@Alkarex
Copy link
Member Author

Alkarex commented Oct 16, 2025

For that specifically I'd just update it automatically after a commit on edge, triggered by having touched a file in the translations folder.

So to refine that idea, a "cron" job[1] that runs every three days or less that checks for example git log -1 --format="%ct" -- app/i18n/ vs the README. Or maybe something even simpler would suffice. It doesn't matter, the point is that if app/i18n/ is newer than README.md, update the README with the new status (IF it actually results in a file change of course).

[1] It uses the same syntax anyway.

Yes, that could be fine. See example:

@Alkarex Alkarex marked this pull request as draft October 16, 2025 19:17
@Alkarex Alkarex removed this from the 1.28.0 milestone Oct 16, 2025
@Alkarex Alkarex closed this Oct 22, 2025
@Alkarex Alkarex added this to the 1.28.0 milestone Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Security 🛡️ System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants