Skip to content

Parse .mc-health.env instead of sourcing it - #4399

Merged
itzg merged 1 commit into
itzg:masterfrom
lbellows:fix/mc-health-no-source
Nov 17, 2026
Merged

itzg merged 1 commit into
itzg:masterfrom
lbellows:fix/mc-health-no-source

Conversation

@lbellows

Copy link
Copy Markdown
Contributor

Fixes GHSA-f5mc-v5xp-jch8.

mc-health runs as root (the HEALTHCHECK and the kustomize probes), but /data is writable by the server user, so sourcing /data/.mc-health.env executed anything written there as root on the next probe. It was also sourced before DISABLE_HEALTHCHECK is checked.

This reads only the known settings from the file instead of sourcing it. The lines start-finalExec writes today (DISABLE_HEALTHCHECK=true, --use-old-server-list-ping, --use-server-list-ping, --use-proxy, each on its own line) are matched as-is, so the writer is unchanged and files left by current images keep working.

Tested against itzg/minecraft-server:latest with each format the writer produces, a missing file, DISABLE_HEALTHCHECK from the environment, and a file containing a shell command (no longer executed).

The healthcheck runs as root but /data is writable by the server, so any
file planted there was executed as root on the next probe. Read only the
known settings from it.

@itzg itzg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tightening that up

@itzg
itzg merged commit 99f8c58 into itzg:master Nov 17, 2026
7 checks passed
@lbellows
lbellows deleted the fix/mc-health-no-source branch November 17, 2026 20:01
gabrielcosi pushed a commit to gabrielcosi/home-ops that referenced this pull request Nov 23, 2026
… βž” 2026.11.1) (#1900)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/itzg/minecraft-server](https://github.com/itzg/docker-minecraft-server) | patch | `2026.11.0-java25` β†’ `2026.11.1-java25` |

---

### Release Notes

<details>
<summary>itzg/docker-minecraft-server (ghcr.io/itzg/minecraft-server)</summary>

### [`v2026.11.1`](https://github.com/itzg/docker-minecraft-server/releases/tag/2026.11.1)

[Compare Source](itzg/docker-minecraft-server@2026.11.0...2026.11.1)

<!-- Release notes generated using configuration in .github/release.yml at 0699bd8497cb1e3c8e257fecd4320671194c6903 -->

#### What's Changed

##### Enhancements

- Support `json` as a value of `LOG_CONSOLE_FORMAT` / `LOG_FILE_FORMAT` for JSON log lines by [@&#8203;eliasehmann](https://github.com/eliasehmann) in [#&#8203;4393](itzg/docker-minecraft-server#4393)
- Exclude client-only Smart Particles and You Must Know This Notice for CurseForge packs by [@&#8203;Wroud](https://github.com/Wroud) in [#&#8203;4396](itzg/docker-minecraft-server#4396)
- Mitigate Java4Shell by disabling UseBASE64Intrinsics for Java 17 and newer versions by [@&#8203;itzg](https://github.com/itzg) in [#&#8203;4400](itzg/docker-minecraft-server#4400)
- Add HANGAR_PROJECTS to download plugins from Hangar by [@&#8203;caunt](https://github.com/caunt) in [#&#8203;4392](itzg/docker-minecraft-server#4392)
- Java4Shell is now fixed in base image by [@&#8203;itzg](https://github.com/itzg) in [#&#8203;4409](itzg/docker-minecraft-server#4409)

##### Documentation

- build(deps): bump the patches group in /docs with 2 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;4402](itzg/docker-minecraft-server#4402)
- build(deps): bump pymdown-extensions from 12.3 to 13.1 in /docs by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;4403](itzg/docker-minecraft-server#4403)
- docs: add Minecraft Server Manager (MSM) to related projects by [@&#8203;anefzaoui](https://github.com/anefzaoui) in [#&#8203;4407](itzg/docker-minecraft-server#4407)

##### Other Changes

- Update dependency itzg/mc-image-helper to v1.76.2 by [@&#8203;renovate](https://github.com/renovate)\[bot] in [#&#8203;4386](itzg/docker-minecraft-server#4386)
- build(deps): bump docker/login-action from 4.7.0 to 4.8.0 in the updates group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;4387](itzg/docker-minecraft-server#4387)
- build(deps): combine docs dependency updates by [@&#8203;itzg](https://github.com/itzg) in [#&#8203;4390](itzg/docker-minecraft-server#4390)
- Update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate)\[bot] in [#&#8203;4391](itzg/docker-minecraft-server#4391)
- Update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate)\[bot] in [#&#8203;4395](itzg/docker-minecraft-server#4395)
- Update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate)\[bot] in [#&#8203;4397](itzg/docker-minecraft-server#4397)
- Update dependency itzg/mc-image-helper to v1.78.1 by [@&#8203;renovate](https://github.com/renovate)\[bot] in [#&#8203;4398](itzg/docker-minecraft-server#4398)
- Parse .mc-health.env instead of sourcing it by [@&#8203;lbellows](https://github.com/lbellows) in [#&#8203;4399](itzg/docker-minecraft-server#4399)
- Update dependency itzg/mc-image-helper to v1.78.2 by [@&#8203;renovate](https://github.com/renovate)\[bot] in [#&#8203;4401](itzg/docker-minecraft-server#4401)
- Update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate)\[bot] in [#&#8203;4410](itzg/docker-minecraft-server#4410)

#### New Contributors

- [@&#8203;eliasehmann](https://github.com/eliasehmann) made their first contribution in [#&#8203;4393](itzg/docker-minecraft-server#4393)
- [@&#8203;anefzaoui](https://github.com/anefzaoui) made their first contribution in [#&#8203;4407](itzg/docker-minecraft-server#4407)

**Full Changelog**: <itzg/docker-minecraft-server@2026.11.0...2026.11.1>

</details>

---

### Configuration

πŸ“… **Schedule**: (in timezone Europe/Berlin)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

πŸ”• **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Operator](https://github.com/mogenius/renovate-operator).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.xcd.dev/gabrielcosi/home-ops/pulls/1900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants