Skip to content

Sanitize openresty include filenames to prevent eval injection#8588

Merged
josegonzalez merged 1 commit into
masterfrom
sanitize-openresty-filenames
May 9, 2026
Merged

Sanitize openresty include filenames to prevent eval injection#8588
josegonzalez merged 1 commit into
masterfrom
sanitize-openresty-filenames

Conversation

@josegonzalez
Copy link
Copy Markdown
Member

@josegonzalez josegonzalez commented May 9, 2026

Add defense-in-depth sanitization for OpenResty include files to prevent OS command injection via malicious filenames that break shell quoting in eval.

  • Add filename validation in core-post-extract using regex [^a-zA-Z0-9_.-]
  • Validate both http-includes and location-includes paths
  • Abort deploy via dokku_log_fail on unsafe filenames
  • Skip non-regular files (symlinks, directories) during extraction
  • Add security regression test with unsafe filename containing space
  • Keep existing guards in docker-args-process-deploy as belt-and-suspenders
  • Update documentation to clarify allowed filename characters

Addresses vulnerability where filenames like poc'$(cmd)'x.conf could escape shell quoting and execute arbitrary commands during deploy.

Add defense-in-depth sanitization for OpenResty include files to prevent
OS command injection via malicious filenames that break shell quoting in eval.

- Add filename validation in core-post-extract using regex [^a-zA-Z0-9_.-]
- Validate both http-includes and location-includes paths
- Abort deploy via dokku_log_fail on unsafe filenames
- Skip non-regular files (symlinks, directories) during extraction
- Add security regression test with unsafe filename containing space
- Keep existing guards in docker-args-process-deploy as belt-and-suspenders
- Update documentation to clarify allowed filename characters

Addresses CVSS 9.9 vulnerability where filenames like poc'$(cmd)'x.conf
could escape shell quoting and execute arbitrary commands during deploy.
@josegonzalez josegonzalez added the type: security Pull requests that address a security vulnerability label May 9, 2026
@josegonzalez josegonzalez changed the title security: sanitize openresty include filenames to prevent eval injection Sanitize openresty include filenames to prevent eval injection May 9, 2026
@josegonzalez josegonzalez merged commit 90aa64e into master May 9, 2026
110 checks passed
@josegonzalez josegonzalez deleted the sanitize-openresty-filenames branch May 9, 2026 19:36
github-actions Bot pushed a commit that referenced this pull request May 10, 2026
# History

## 0.38.2

Install/update via the bootstrap script:

```shell
wget -NP . https://dokku.com/install/v0.38.2/bootstrap.sh
sudo DOKKU_TAG=v0.38.2 bash bootstrap.sh
```

### Security

- #8590: @josegonzalez Restrict app names to prevent command injection
- #8591: @josegonzalez Harden archive extraction against symlink traversal
- #8589: @josegonzalez Enforce 0600 permissions on .netrc credentials file
- #8588: @josegonzalez Sanitize openresty include filenames to prevent eval injection

### Bug Fixes

- #8593: @josegonzalez Gate ssl_reject_handshake behind nginx 1.19.4
- #8578: @josegonzalez Reference SOURCECODE_WORK_DIR in builder core-post-extract

### Documentation

- #8592: @josegonzalez Add security section to release changelog
- #8587: @vixalien Correct buildkit builder code block syntax
- #8580: @othercorey Set issue type in bug report template

### Tests

- #8586: @josegonzalez Count assert_output_contains matches as fixed strings
- #8581: @dependabot[bot] chore(deps): bump golang from 1.26.2 to 1.26.3 in /tests/apps/go-fail-predeploy
- #8582: @dependabot[bot] chore(deps): bump golang from 1.26.2 to 1.26.3 in /tests/apps/gogrpc
- #8584: @dependabot[bot] chore(deps): bump golang from 1.26.2 to 1.26.3 in /tests/apps/go-fail-postdeploy
- #8583: @dependabot[bot] chore(deps): bump golang from 1.26.2 to 1.26.3 in /tests/apps/zombies-dockerfile-tini
- #8585: @dependabot[bot] chore(deps): bump golang from 1.26.2 to 1.26.3 in /tests/apps/zombies-dockerfile-no-tini
- #8574: @dependabot[bot] chore(deps): bump node from 25-alpine to 26-alpine in /tests/apps/dockerfile-noexpose
- #8575: @dependabot[bot] chore(deps): bump node from 25-alpine to 26-alpine in /tests/apps/dockerfile-procfile-bad
- #8577: @dependabot[bot] chore(deps): bump node from 25-alpine to 26-alpine in /tests/apps/dockerfile-app-json-formations
- #8576: @dependabot[bot] chore(deps): bump node from 25-alpine to 26-alpine in /tests/apps/dockerfile
- #8573: @dependabot[bot] chore(deps): bump node from 25-alpine to 26-alpine in /tests/apps/dockerfile-procfile

### Dependencies

- #8579: @josegonzalez Use type prefix for dokku-bot dependency label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: security Pull requests that address a security vulnerability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant