Skip to content

Commit 8cd4fea

Browse files
fix(php): publish legacy security backports under maintenance tags
1 parent e8f65bf commit 8cd4fea

9 files changed

Lines changed: 65 additions & 26 deletions

File tree

‎.cnb.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ main:
3333
image_version="${PHP_IMAGE_VERSION:-}"
3434
if [ -z "$image_version" ]; then
3535
case "$PHP_VERSION" in
36+
5.6.40) image_version=5.6.41 ;;
37+
7.0.33) image_version=7.0.34 ;;
38+
7.1.33) image_version=7.1.34 ;;
39+
7.2.34) image_version=7.2.35 ;;
40+
7.3.33) image_version=7.3.34 ;;
3641
7.4.33) image_version=7.4.34 ;;
3742
8.0.30) image_version=8.0.31 ;;
3843
8.1.34) image_version=8.1.35 ;;
@@ -52,4 +57,4 @@ main:
5257
-t $IMAGE_TAG
5358
-f php/$DIR/Dockerfile
5459
php/$DIR/
55-
--push
60+
--push

‎.github/workflows/php5-release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
workflow_dispatch:
66
inputs:
77
php56Version:
8-
description: 'PHP 5.6 Version'
9-
default: '5.6.40'
8+
description: '1Panel maintenance image version (PHP remains 5.6.40)'
9+
default: '5.6.41'
1010
required: true
1111

1212
jobs:

‎.github/workflows/php7-legacy-release.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build PHP 7 Legacy Images
2-
run-name: Build PHP 7 Legacy Images 7.0.33, 7.1.33, 7.2.34
2+
run-name: Build PHP 7 Legacy Images 7.0.34, 7.1.34, 7.2.35
33

44
on:
55
workflow_dispatch:
@@ -9,13 +9,19 @@ permissions:
99

1010
jobs:
1111
docker:
12-
name: Build PHP Image ${{ matrix.phpVersion }}
12+
name: Build PHP Image ${{ matrix.imageVersion }} (PHP ${{ matrix.phpVersion }})
1313
runs-on: ubuntu-latest
1414
strategy:
1515
fail-fast: false
1616
max-parallel: 1
1717
matrix:
18-
phpVersion: ["7.0.33", "7.1.33", "7.2.34"]
18+
include:
19+
- phpVersion: "7.0.33"
20+
imageVersion: "7.0.34"
21+
- phpVersion: "7.1.33"
22+
imageVersion: "7.1.34"
23+
- phpVersion: "7.2.34"
24+
imageVersion: "7.2.35"
1925
steps:
2026
- name: Checkout
2127
uses: actions/checkout@v5
@@ -39,6 +45,6 @@ jobs:
3945
file: php/${{ matrix.phpVersion }}/Dockerfile
4046
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
4147
push: true
42-
tags: 1panel/php:${{ matrix.phpVersion }}-fpm
48+
tags: 1panel/php:${{ matrix.imageVersion }}-fpm
4349
cache-from: type=gha,scope=php-legacy-${{ matrix.phpVersion }}
4450
cache-to: type=gha,mode=max,scope=php-legacy-${{ matrix.phpVersion }}

‎.github/workflows/php7-release.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build PHP 7 Image
2-
run-name: Build PHP 7 Image ${{ github.event.inputs.php74ImageVersion }}, ${{ github.event.inputs.php73Version }}
2+
run-name: Build PHP 7 Image ${{ github.event.inputs.php74ImageVersion }}, ${{ github.event.inputs.php73ImageVersion }}
33

44
on:
55
workflow_dispatch:
@@ -23,9 +23,13 @@ on:
2323
default: true
2424
required: false
2525
php73Version:
26-
description: 'PHP 7.3 Version'
26+
description: 'Official PHP 7.3 base version (7.3.33)'
2727
default: '7.3.33'
2828
required: true
29+
php73ImageVersion:
30+
description: '1Panel maintenance image version (PHP remains 7.3.33)'
31+
default: '7.3.34'
32+
required: true
2933

3034
jobs:
3135
docker:
@@ -72,6 +76,6 @@ jobs:
7276
build-args:
7377
PHP_VERSION=${{ github.event.inputs.php73Version }}
7478
tags: |
75-
1panel/php:${{ github.event.inputs.php73Version }}-fpm
79+
1panel/php:${{ github.event.inputs.php73ImageVersion }}-fpm
7680
cache-from: type=gha
7781
cache-to: type=gha,mode=max

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ Commit and push the fixes, then select that branch in Actions. Existing images a
4242

4343
| Action | Inputs | Published `1panel/php` tags |
4444
| --- | --- | --- |
45-
| Build PHP 5 Image | `php56Version=5.6.40` | `5.6.40-fpm` (amd64) |
46-
| Build PHP 7 Legacy Images | No inputs; builds all three versions | `7.0.33-fpm`, `7.1.33-fpm`, `7.2.34-fpm` |
47-
| Build PHP 7 Image | `buildPhp74=true`, `php74Version=7.4.33`, `php74ImageVersion=7.4.34`, `buildPhp73=true`, `php73Version=7.3.33` | `7.4.34-fpm`, `7.3.33-fpm` |
45+
| Build PHP 5 Image | `php56Version=5.6.41` | `5.6.41-fpm` (amd64) |
46+
| Build PHP 7 Legacy Images | No inputs; builds all three versions | `7.0.34-fpm`, `7.1.34-fpm`, `7.2.35-fpm` |
47+
| Build PHP 7 Image | `buildPhp74=true`, `php74Version=7.4.33`, `php74ImageVersion=7.4.34`, `buildPhp73=true`, `php73Version=7.3.33`, `php73ImageVersion=7.3.34` | `7.4.34-fpm`, `7.3.34-fpm` |
4848
| Build PHP 8 Image | Run twice: `phpVersion=8.0.30`, then `8.1.34` | `8.0.31-fpm`, `8.1.35-fpm` |
4949

5050
The legacy PHP 7 Action uses the existing Dockerfiles and preserves the previous workflow's amd64/arm64/arm/v7 platform list; local PECL installation checks cover amd64 only. The alternative `php/5.6` context remains available through CNB. Both 5.6 contexts include the PECL fix.
@@ -53,7 +53,7 @@ For PHP 8.2+, rebuild only images whose PEAR is older than 1.10.17. `Build PHP 8
5353

5454
## PHP EOL source backports
5555

56-
PHP 5.6.40, 7.0.33, 7.1.33, 7.2.34 and 7.3.33 builds also apply SHA256-pinned local source backports, including the alternate `php/5.6` context. The third-party starting patches have been supplemented with applicable allocation-overflow, VM and request-state changes from PHP's minimal backport. Image tags and internal PHP versions stay unchanged. Use `tests/check-php-legacy-backport.py` for source checks and `tests/check-php-legacy-runtime.py IMAGE` for actual CLI/FPM regressions. These branches remain EOL; provenance, behavior changes and validation instructions are documented below.
56+
PHP 5.6.40, 7.0.33, 7.1.33, 7.2.34 and 7.3.33 builds also apply SHA256-pinned local source backports, including the alternate `php/5.6` context. The third-party starting patches have been supplemented with applicable allocation-overflow, VM and request-state changes from PHP's minimal backport. The maintenance image tags are `5.6.41-fpm`, `7.0.34-fpm`, `7.1.34-fpm`, `7.2.35-fpm` and `7.3.34-fpm`; internal PHP versions retain the real baselines above. Use `tests/check-php-legacy-backport.py` for source checks and `tests/check-php-legacy-runtime.py IMAGE` for actual CLI/FPM regressions. These branches remain EOL; provenance, behavior changes and validation instructions are documented below.
5757

5858
PHP 7.4.33, 8.0.30 and 8.1.34 builds apply the official minimal source backports for CVE-2026-109618 / CVE-2026-109619 and rebuild PHP. These branches remain EOL; older patch levels in these series now fail explicitly. `1panel/php:7.4.34-fpm`, `8.0.31-fpm` and `8.1.35-fpm` are 1Panel maintenance image tags based on official PHP 7.4.33, 8.0.30 and 8.1.34 respectively; their internal PHP versions remain unchanged. See [implementation, compatibility changes and validation](php/EOL-BACKPORT.md).
5959

‎README_zh.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ PHP 5.6、PHP 7 和 PHP 8 镜像在编译 PHP 后安装固定版本、校验 SHA
4242

4343
| Action | 参数 | 发布的 `1panel/php` 标签 |
4444
| --- | --- | --- |
45-
| Build PHP 5 Image | `php56Version=5.6.40` | `5.6.40-fpm`(amd64) |
46-
| Build PHP 7 Legacy Images | 无参数,一次构建三个版本 | `7.0.33-fpm`、`7.1.33-fpm`、`7.2.34-fpm` |
47-
| Build PHP 7 Image | `buildPhp74=true`、`php74Version=7.4.33`、`php74ImageVersion=7.4.34`、`buildPhp73=true`、`php73Version=7.3.33` | `7.4.34-fpm`、`7.3.33-fpm` |
45+
| Build PHP 5 Image | `php56Version=5.6.41` | `5.6.41-fpm`(amd64) |
46+
| Build PHP 7 Legacy Images | 无参数,一次构建三个版本 | `7.0.34-fpm`、`7.1.34-fpm`、`7.2.35-fpm` |
47+
| Build PHP 7 Image | `buildPhp74=true`、`php74Version=7.4.33`、`php74ImageVersion=7.4.34`、`buildPhp73=true`、`php73Version=7.3.33`、`php73ImageVersion=7.3.34` | `7.4.34-fpm`、`7.3.34-fpm` |
4848
| Build PHP 8 Image | 分别运行两次:`phpVersion=8.0.30`、`8.1.34` | `8.0.31-fpm`、`8.1.35-fpm` |
4949

5050
旧 PHP 7 Action 使用已有 Dockerfile,保留此前工作流的 amd64/arm64/arm/v7 平台列表;本地 PECL 安装验证仅覆盖 amd64。备用 `php/5.6` 构建目录仍可通过 CNB 选择,两个 5.6 目录均包含 PECL 修复。
@@ -53,7 +53,7 @@ PHP 8.2+ 仅在镜像内 PEAR 低于 1.10.17 时需要为本问题重打。`Buil
5353

5454
## PHP EOL 源码回补
5555

56-
PHP 5.6.40、7.0.33、7.1.33、7.2.34 和 7.3.33 的构建也会应用固定 SHA256 的本地源码回补。补丁以第三方回补为起点,并补齐官方最小回补中适用于各旧分支的分配溢出、VM 和请求状态清理等改动;备用 `php/5.6` 入口同样覆盖。镜像标签和内部 PHP 版本保持原值。源码校验使用 `tests/check-php-legacy-backport.py`,实际 CLI/FPM 回归使用 `tests/check-php-legacy-runtime.py IMAGE`。这些旧分支仍为 EOL,详细来源、行为变化和验证方式见下方说明。
56+
PHP 5.6.40、7.0.33、7.1.33、7.2.34 和 7.3.33 的构建也会应用固定 SHA256 的本地源码回补。补丁以第三方回补为起点,并补齐官方最小回补中适用于各旧分支的分配溢出、VM 和请求状态清理等改动;备用 `php/5.6` 入口同样覆盖。维护版镜像标签分别为 `5.6.41-fpm`、`7.0.34-fpm`、`7.1.34-fpm`、`7.2.35-fpm`、`7.3.34-fpm`,内部 PHP 版本仍保留上述真实基线。源码校验使用 `tests/check-php-legacy-backport.py`,实际 CLI/FPM 回归使用 `tests/check-php-legacy-runtime.py IMAGE`。这些旧分支仍为 EOL,详细来源、行为变化和验证方式见下方说明。
5757

5858
PHP 7.4.33、8.0.30 和 8.1.34 构建会应用官方针对 CVE-2026-109618 / CVE-2026-109619 的最小源码回补并重新编译 PHP。这些分支仍为 EOL,同系列更早的补丁版本现在会明确失败。`1panel/php:7.4.34-fpm`、`8.0.31-fpm` 和 `8.1.35-fpm` 为 1Panel 维护版镜像标签,分别基于官方 PHP 7.4.33、8.0.30、8.1.34 加上述回补,内部 PHP 版本保持原值。详见[实现、兼容性变化和验证说明](php/EOL-BACKPORT.md)。
5959

‎php/EOL-BACKPORT.md‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## PHP 5.6 and 7.0–7.3
44

5-
The exact baselines **5.6.40, 7.0.33, 7.1.33, 7.2.34 and 7.3.33** also receive locally maintained source backports. These are not official PHP security releases or continued support for these branches. Internal PHP versions and the existing image tags remain unchanged.
5+
The exact baselines **5.6.40, 7.0.33, 7.1.33, 7.2.34 and 7.3.33** also receive locally maintained source backports. These are not official PHP security releases or continued support for these branches. Internal PHP versions remain unchanged; publication uses the distinct 1Panel maintenance image tags listed below.
66

77
The starting patches are from [vperetti's backports at `6296d6baf05cd2e727e66d38b8f33caf60d90896`](https://github.com/vperetti/php-cve-2026-109618-109619-backports/tree/6296d6baf05cd2e727e66d38b8f33caf60d90896). They have been supplemented by comparison with the PHP project's [7.4 minimal backport](https://github.com/php/php-src/commit/712e60f9edfd03f0960fc4fc3c2c375f42b90aa2):
88

@@ -85,19 +85,31 @@ These are **1Panel maintenance image tags**, not new official PHP releases:
8585

8686
| Official base / internal PHP version | 1Panel output image |
8787
| --- | --- |
88+
| 5.6.40 | `1panel/php:5.6.41-fpm` |
89+
| 7.0.33 | `1panel/php:7.0.34-fpm` |
90+
| 7.1.33 | `1panel/php:7.1.34-fpm` |
91+
| 7.2.34 | `1panel/php:7.2.35-fpm` |
92+
| 7.3.33 | `1panel/php:7.3.34-fpm` |
8893
| 7.4.33 | `1panel/php:7.4.34-fpm` |
8994
| 8.0.30 | `1panel/php:8.0.31-fpm` |
9095
| 8.1.34 | `1panel/php:8.1.35-fpm` |
9196

9297
`php -v`, `PHP_VERSION`, `php-config`, source checksums and every `FROM php:${PHP_VERSION}-fpm` retain the real official baseline in the left column. Do not pass the maintenance tag version as the Docker build's `PHP_VERSION`.
9398

94-
The PHP 7 workflow has separate inputs: `php74Version` defaults to `7.4.33` (base), and `php74ImageVersion` defaults to `7.4.34` (output image). Both `buildPhp74` and `buildPhp73` default to true. Set `buildPhp73=false` to publish only the 7.4 maintenance image, or `buildPhp74=false` to publish only 7.3. The normal PHP 8 workflow maps the exact inputs `8.0.30` and `8.1.34` to maintenance output tags; all other inputs, including 8.2+, keep their previous output tags. Its input names/defaults and Docker build argument are unchanged. The four-version PHP 8 security workflow is unchanged.
99+
The PHP 5 workflow keeps its existing `php56Version` input for the output tag only, now defaulting to `5.6.41`; its source context remains fixed at `php/5.6.40`. The legacy PHP 7 matrix keeps each source baseline in `phpVersion` and stores its maintenance tag in `imageVersion`, preserving the existing source directories, cache scopes and platform list.
95100

96-
CNB's PHP build accepts optional `PHP_IMAGE_VERSION`. When blank, the three exact EOL baselines above map to their maintenance tags; all other versions keep the original `PHP_VERSION` output tag. An explicit `PHP_IMAGE_VERSION` overrides only the output tag. For example, set `DIR=7`, `PHP_VERSION=7.4.33` (or `DIR=8`, `PHP_VERSION=8.0.30` / `8.1.34`). The Docker build argument remains `PHP_VERSION`.
101+
The PHP 7 workflow has separate inputs: `php74Version` defaults to `7.4.33` (base), and `php74ImageVersion` defaults to `7.4.34` (output image). `php73Version=7.3.33` and `php73ImageVersion=7.3.34` provide the same base/output separation for 7.3. Both `buildPhp74` and `buildPhp73` default to true. Set `buildPhp73=false` to publish only the 7.4 maintenance image, or `buildPhp74=false` to publish only 7.3. The normal PHP 8 workflow maps the exact inputs `8.0.30` and `8.1.34` to maintenance output tags; all other inputs, including 8.2+, keep their previous output tags. Its input names/defaults and Docker build argument are unchanged. The four-version PHP 8 security workflow is unchanged.
102+
103+
CNB's PHP build accepts optional `PHP_IMAGE_VERSION`. When blank, the eight exact EOL baselines above map to their maintenance tags; all other versions keep the original `PHP_VERSION` output tag. An explicit `PHP_IMAGE_VERSION` overrides only the output tag. For example, set `DIR=7`, `PHP_VERSION=7.4.33` (or `DIR=8`, `PHP_VERSION=8.0.30` / `8.1.34`). The Docker build argument remains `PHP_VERSION`.
97104

98105
For direct builds:
99106

100107
```sh
108+
docker build -t 1panel/php:5.6.41-fpm php/5.6.40
109+
docker build -t 1panel/php:7.0.34-fpm php/7.0.33
110+
docker build -t 1panel/php:7.1.34-fpm php/7.1.33
111+
docker build -t 1panel/php:7.2.35-fpm php/7.2.34
112+
docker build --build-arg PHP_VERSION=7.3.33 -t 1panel/php:7.3.34-fpm php/7
101113
docker build --build-arg PHP_VERSION=7.4.33 -t 1panel/php:7.4.34-fpm php/7
102114
docker build --build-arg PHP_VERSION=8.0.30 -t 1panel/php:8.0.31-fpm php/8
103115
docker build --build-arg PHP_VERSION=8.1.34 -t 1panel/php:8.1.35-fpm php/8

‎tests/check-php-eol-backport.py‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,16 @@
7676
assert "php74ImageVersion:\n description: '1Panel maintenance image version (PHP remains 7.4.33)'\n default: '7.4.34'" in php7
7777
assert 'PHP_VERSION=${{ github.event.inputs.php74Version }}' in php7
7878
assert '1panel/php:${{ github.event.inputs.php74ImageVersion }}-fpm' in php7
79-
assert '1panel/php:${{ github.event.inputs.php73Version }}-fpm' in php7
79+
assert "php73Version:\n description: 'Official PHP 7.3 base version (7.3.33)'\n default: '7.3.33'" in php7
80+
assert "php73ImageVersion:\n description: '1Panel maintenance image version (PHP remains 7.3.33)'\n default: '7.3.34'" in php7
81+
assert 'PHP_VERSION=${{ github.event.inputs.php73Version }}' in php7
82+
assert '1panel/php:${{ github.event.inputs.php73ImageVersion }}-fpm' in php7
83+
assert '1panel/php:${{ github.event.inputs.php73Version }}-fpm' not in php7
84+
php5 = (root / '.github/workflows/php5-release.yml').read_text()
85+
assert "php56Version:\n description: '1Panel maintenance image version (PHP remains 5.6.40)'\n default: '5.6.41'" in php5
86+
assert 'context: php/5.6.40' in php5 and 'file: php/5.6.40/Dockerfile' in php5
87+
assert '1panel/php:${{ github.event.inputs.php56Version }}-fpm' in php5
88+
assert 'PHP_VERSION=${{ github.event.inputs.php56Version }}' not in php5
8089
assert "buildPhp73:\n description: 'Also build and publish PHP 7.3'\n type: boolean\n default: true" in php7
8190
assert 'Build PHP-7.3 and Push\n if: ${{ inputs.buildPhp73 }}' in php7
8291
cnb = (root / '.cnb.yml').read_text()
@@ -87,12 +96,14 @@
8796
assert '1panel/php:${{ steps.image.outputs.version }}-fpm' in php8
8897
tag_step = textwrap.dedent(php8.split(' run: |\n', 1)[1].split('\n - name:', 1)[0])
8998
cnb_step = textwrap.dedent(cnb.split('web_trigger_build_php_image:', 1)[1].split(' script: |\n', 1)[1].split('\n exports:', 1)[0])
90-
for base, expected in [('7.4.33', '7.4.34'), ('8.0.30', '8.0.31'), ('8.1.34', '8.1.35'),
99+
for base, expected in [('5.6.40', '5.6.41'), ('7.0.33', '7.0.34'), ('7.1.33', '7.1.34'),
100+
('7.2.34', '7.2.35'), ('7.3.33', '7.3.34'),
101+
('7.4.33', '7.4.34'), ('8.0.30', '8.0.31'), ('8.1.34', '8.1.35'),
91102
('8.2.35', '8.2.35'), ('8.3.36', '8.3.36'), ('8.4.27', '8.4.27'), ('8.5.12', '8.5.12')]:
92103
with tempfile.TemporaryDirectory() as tmp:
93104
output = Path(tmp) / 'output'
94105
env = dict(os.environ, PHP_VERSION=base, PHP_IMAGE_VERSION='', DOCKER_REGISTRY='registry', DOCKER_GROUP='1panel', GITHUB_OUTPUT=str(output))
95-
if not base.startswith('7.'):
106+
if base.startswith('8.'):
96107
subprocess.run(['sh', '-eu', '-c', tag_step], env=env, check=True)
97108
assert output.read_text().strip() == 'version=' + expected
98109
tag = subprocess.check_output(['sh', '-eu', '-c', cnb_step], env=env, text=True)

‎tests/check-php-pecl-source.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525
subprocess.run(['sh', '-n', '-c', command], check=True)
2626

2727
workflow = (root / '.github/workflows/php7-legacy-release.yml').read_text()
28-
assert 'phpVersion: ["7.0.33", "7.1.33", "7.2.34"]' in workflow
28+
assert re.findall(r'- phpVersion: "([^"]+)"\s+imageVersion: "([^"]+)"', workflow) == [
29+
('7.0.33', '7.0.34'), ('7.1.33', '7.1.34'), ('7.2.34', '7.2.35')]
2930
assert 'context: php/${{ matrix.phpVersion }}' in workflow
3031
assert 'file: php/${{ matrix.phpVersion }}/Dockerfile' in workflow
31-
assert 'tags: 1panel/php:${{ matrix.phpVersion }}-fpm' in workflow
32+
assert 'tags: 1panel/php:${{ matrix.imageVersion }}-fpm' in workflow
3233
assert 'context: php/5.6.40' in (root / '.github/workflows/php5-release.yml').read_text()
3334
subprocess.run(['bash', '-n', str(root / 'tests/check-php-pecl.sh')], check=True)
3435
print('PASS: seven PECL bootstraps, RUN shell syntax, legacy CA and release contexts')

0 commit comments

Comments
 (0)