feat(image): run the Directus 8.8.1 core on PHP 8.5 as a base image #1

Merged
pienter merged 2 commits from feature/DI-1-port-directus-8-core-to-php-85-and-publish-base-im into main 2026-10-23 15:04:07 +00:00
Owner

Why

Art of Sports, JVDV and Tuinen Daan all run Directus 8.8.1 on PHP 7.4. Since php2shell (CVE-2026-109618, CVE-2026-109619), all three are offline, because PHP 7.4 gets no fix. This PR makes the Directus 8.8.1 core run on PHP 8.5.12, which carries the fix. It is packaged as one base image, git.pienter.space/pienter/directus-v8. Each site will build FROM it and add only its own config, custom extensions, env and upload paths, so the next PHP fix is one rebuild here plus a tag bump per site. Directus version, schema, admin app and REST API stay the same, except that the unused GraphQL endpoint is removed. Abandoned or outdated libraries are replaced or upgraded (Swift Mailer → Symfony Mailer, php-jwt 7, Phinx 0.16). Three upstream token-forgery holes are closed, the worst of which let anyone log in as any user.

For you

  • Decide: psr/simple-cache is required as "2.0.0 as 1.0.1" (composer.json:43). Phinx 0.16's cakephp/database needs simple-cache 2, while cache/adapter-common 1.3 (latest) still declares ^1.0. 2.0 only adds parameter types; every cache pool loads and works. composer validate warns about the alias. Accepted in DI-1.
  • Decide: Symfony majors are mixed: mailer 7.4 LTS with mime, event-dispatcher and console 8.1. Accepted; tags are immutable and the next rebuild resolves fresh.
  • Decide: only one advisory stays ignored, flysystem 1.x (composer.json:93). Directus 8 storage is built on the Flysystem 1 API.
  • Decide: an empty mail encryption now means STARTTLS when offered; Swift sent plaintext. For SES, set tls.
  • Decide: ATTR_STRINGIFY_FETCHES keeps PHP 7's string results from pdo_mysql. API output on 38 endpoints was identical with and without it. It is kept for internal comparisons and project hooks written against strings.
  • Verify by hand: only the arm64 image was built and tested. Before pushing the tag, build amd64 (Dokploy) and run a php -v and /server/ping check on it.
  • Verify by hand: sites with an auth secret shorter than 32 bytes return 500 "Provided key is too short" on login. Each consumer task checks and rotates its secret before switching image.
  • Verify by hand: the image is not published yet. After merge, run docker login git.pienter.space, then the buildx push in README.md:215. Check that the package is public with an anonymous docker pull.

Review guide

1. Runtime image. Directus 8 resolves its base path from src/web.php, so the core stays at the image's project root, and consumers copy their files into the same tree.

  • Dockerfile:7 runtime stage: pinned php:8.5.12-apache-trixie, with the same extensions, Apache modules and docker/ config as the AOS image. curl and mbstring are already built into the official image.
  • Dockerfile:47-73 final stage: composer install --no-dev --optimize-autoloader, without a classmap-authoritative autoloader, so consumer classes under public/extensions/custom still autoload through PSR-4.
  • docker/php-directus.ini: display_errors=Off, and deprecations go to the log. Without this, PHP 8.5 notices broke the JSON responses, including /server/ping.
  • Check: the uploads dirs under public/uploads/_ are created and owned by www-data. Consumers with other paths (JVDV jvdv-api, TND tnd) must create their own.

2. PHP 8 breaks in the zend-db fork. These are real 500s found on the AOS DB copy, not lint findings.

  • packages/zend-db/src/Sql/AbstractSql.php:256-271: vsprintf gets (array), and count follows PHP 7 semantics for scalars and null. This fixed a TypeError on items?meta=* (countByStatus).
  • packages/zend-db/src/Stdlib/PriorityList.php, copied from zend-stdlib 3.2.1, and Update.php:15 now imports it, so the abandoned zend-stdlib dependency is gone.
  • Sql/Ddl/Column/Float.php is deleted: Float is a reserved class name, so the file could never load. It was the only lint fatal.
  • Check: the count() fallback (null → 0, scalar → 1) matches PHP 7.4 for every $paramSpecs key that reaches it.

3. PHP 8 breaks in the core.

  • src/core/Directus/Hook/Emitter.php:291-293: call_user_func_array($listener, array_values($data)). PHP 8 reads string keys as named arguments, which made POST /_/files fail with "Unknown named parameter $name".
  • src/web.php:72-74: development mode no longer shows deprecations, so dev responses stay valid JSON. Production already reported nothing.
  • Check: a listener that relied on keys being passed positionally in their array order behaves the same. array_values keeps that order.

4. Dependencies. "php": "^8.5", plus Guzzle 6.5 → 7.16, symfony/validator 3.4 → 5.4, split cache/* 1.x adapters instead of the PHP 7-only monolith, ip-address-middleware 1.0 → 2.6, and the latest compatible minor everywhere else.

  • composer.json:24 and composer.json:91 (advisory policy).
  • Check: project hooks use Guzzle's Client::post/request, which is unchanged in 7. Anything relying on Guzzle 6 internals (GuzzleHttp\Psr7\ functions) would break.

5. Token verification (security). Upstream only base64-decoded several tokens and trusted their claims. A control run of the old code issued an admin token for a forged, unsigned SSO request token.

  • AuthService.php:325-352 authenticateWithSsoRequestToken: the public POST /auth/sso/access_token now verifies signature and expiry via Provider::getTokenPayload before issuing an access token for $payload->id.
  • UsersService.php:296 enableUserWithInvitation and AuthService.php:436 resetPasswordWithToken: same verification. A forged invite token used to activate a pending invite.
  • AuthService.php:485 refreshToken: verifies first, so malformed tokens get 401 instead of a 500.
  • Provider.php:658 getTokenPayload is now public; it is the core's existing verify path (project secret, HS256, origin check).
  • Check: every token type keeps its type, origin and email checks after verification; expired tokens map to each endpoint's existing "expired" error.

6. Mail: Swift Mailer → Symfony Mailer. Swift Mailer was abandoned in 2021. All sites will send through Amazon SES over SMTP, configured only through the existing mail.default.* keys / DIRECTUS_MAIL_DEFAULT_* env.

  • Message.php:14 Message extends Email and keeps the Swift-style setters hooks use (setTo, setFrom, setReplyTo, setBody:97, addPart:123).
  • SmtpTransport.php:27-34: ssl = implicit TLS, tls = required STARTTLS.
  • Mailer.php:87: transport errors are logged and rethrown as MailNotSentException, so reset, invite and /mail no longer return the SMTP reply and username.
  • Check: project hooks calling Swift-only methods (Swift_* classes, Swift's addTo($addr, $name)) break. AOS's SES helper does; AOS-9 replaces it with the core helpers.

7. GraphQL removed. Unused by the admin app and every frontend, and it carried three advisories with fixes only in graphql-php 15.

  • src/endpoints/GraphQL.php, src/core/Directus/GraphQL/ (29 files), GraphQLService, the /gql route in src/web.php and its cache branch in ResponseCacheMiddleware. /gql answers 404.

8. php-jwt 7 and Phinx 0.16.

  • JWTUtils.php:30 decodes with new Key($key, $alg); :57 casts the payload to array (refresh passes a stdClass). Secrets must be ≥32 bytes.
  • migrations/migrations.php:12 feature flags and InstallerUtils.php:736-737 collation keep Phinx 0.9's schema on fresh installs. Two upgrade migrations add ->save() after drop(), which only queues since 0.10.
  • CoreServicesProvider.php:155: Monolog 3 (forced by Phinx via psr/log 3) uses Level::cases(); log file names are unchanged.
  • Check: the fresh-install schema is byte-identical to the Phinx 0.9 image only for MariaDB 10.11; other servers weren't tested.

Skim:

  • app/ and the upstream example extensions removed (the old 2022 tree).
  • packages/*/composer.json: php constraint and explicit versions.
  • packages/directus-* (9 packages, 178 files) deleted: unused copies, not in composer repositories, require or autoload.
  • composer.lock, .gitignore, .dockerignore.
  • README.md: consumer contract, tag scheme <directus>-php<php>[-r<n>], auth-secret rule, ## Mail (env keys, SES, Message API), build and publish.
  • AGENTS.md, ws.toml, docs/agents/issue-tracker.md: Windshift DI.
  • LICENSE.md.

Evidence

Before: on PHP 8.5 without the fixes, GET items/<collection>?meta=* returned 500 (TypeError in AbstractSql) for pages, header, top_header and Group_Training_Types. POST /_/files returned 500 ("Unknown named parameter $name"). /server/ping responses carried deprecation notices.
After: git.pienter.space/pienter/directus-v8:8.8.1-php8.5.12, built locally and run against a MariaDB 10.11 copy of the AOS database. /server/info reports PHP 8.5.12, Directus 8.8.1. Head 61f664a: smoke 77/77, smoke2 89/89 and flows 38/38, in production and development mode; the throwaway AOS consumer passes the same. First commit: 75/75 and 89/89.

  • Covered:
    • /server/ping, and the admin app with its static assets.
    • Login, wrong password and refresh; 21 admin bootstrap endpoints.
    • 25 public collection reads, and public denial of Contact_Form_Responses and directus_users.
    • Public contact form create.
    • Item edit with revision and revert.
    • Multipart upload with thumbnails and /_/assets; an existing AOS media thumbnail.
    • Filters, sort, meta and batch PATCH; /gql → 404.
    • Schema paths: create collection, add FLOAT, ALTER, drop.
    • CLI db:upgrade on the AOS copy: applies nothing.
    • Fresh install (install:database, install:install) on an empty MariaDB: schema, system data and 79 migration rows identical to the Phinx 0.9 image; the full upgrade path too.
    • Mail via Mailpit with STARTTLS required and SMTP auth: reset and invite mails with the right from/to/subject and token in the HTML.
    • Tokens: login, refresh, reset, invite. Forged SSO, invite and reset tokens (bad signature, wrong secret, alg: none, wrong type, signed but expired) → 401 with each endpoint's existing error, and no state change. Garbage refresh tokens → 401.
    • Wrong SMTP password: reset, invite and /mail return the generic 503 mail error with no SMTP text; the log has the TransportException.
    • Control run with the old AuthService: forged SSO tokens got 200 with an admin token (35/38), so the tests catch the hole.
    • A throwaway consumer (FROM this tag plus AOS's config/ and public/extensions/custom) passes the same sets. AOS's custom mail endpoint, its SES contact hook and its Dokploy rebuild hook all loaded and ran up to their missing env vars.
  • Checks:
    • docker build succeeds.
    • php -l on 2921 PHP files: 0 failures.
    • composer validate valid (alias and @dev path warnings); composer audit lists only the ignored flysystem advisory.
    • Runtime error log: 0 fatals, and one pre-existing E_WARNING (src/helpers/file.php:138 undefined private_hash, a notice on 7.4).
    • The container healthcheck reports healthy.
  • Not covered: real SES delivery and frontend rebuilds (project-specific), the real OAuth SSO callback (no provider configured; a validly signed request token was minted the way the core does), the amd64 build, and install:config on a fresh checkout (it fails the same way on 7.4).

Tests: none in the repo; the smoke scripts were throwaway.

Merge Danger

Door: two-way

Merging publishes nothing and deploys nothing. The image push is a separate manual step, and no site uses this repo yet.

Blast Radius: none-yet

Once AOS-9, JVDV-10 and DVPL-2 build FROM the tag, a defect here reaches all three sites. The image breaks AOS's Swift-based contact notification and short auth secrets, so each site moves only together with its consumer task. Tags are immutable (-r<n> for rebuilds), so each site can pin back to the tag it used before.

## Why Art of Sports, JVDV and Tuinen Daan all run Directus 8.8.1 on PHP 7.4. Since php2shell (CVE-2026-109618, CVE-2026-109619), all three are offline, because PHP 7.4 gets no fix. This PR makes the Directus 8.8.1 core run on PHP 8.5.12, which carries the fix. It is packaged as one base image, `git.pienter.space/pienter/directus-v8`. Each site will build `FROM` it and add only its own config, custom extensions, env and upload paths, so the next PHP fix is one rebuild here plus a tag bump per site. Directus version, schema, admin app and REST API stay the same, except that the unused GraphQL endpoint is removed. Abandoned or outdated libraries are replaced or upgraded (Swift Mailer → Symfony Mailer, php-jwt 7, Phinx 0.16). Three upstream token-forgery holes are closed, the worst of which let anyone log in as any user. ## For you - **Decide:** `psr/simple-cache` is required as `"2.0.0 as 1.0.1"` ([composer.json:43](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/composer.json#L43)). Phinx 0.16's cakephp/database needs simple-cache 2, while `cache/adapter-common` 1.3 (latest) still declares `^1.0`. 2.0 only adds parameter types; every cache pool loads and works. `composer validate` warns about the alias. Accepted in DI-1. - **Decide:** Symfony majors are mixed: mailer 7.4 LTS with mime, event-dispatcher and console 8.1. Accepted; tags are immutable and the next rebuild resolves fresh. - **Decide:** only one advisory stays ignored, flysystem 1.x ([composer.json:93](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/composer.json#L93)). Directus 8 storage is built on the Flysystem 1 API. - **Decide:** an empty mail `encryption` now means STARTTLS when offered; Swift sent plaintext. For SES, set `tls`. - **Decide:** [ATTR_STRINGIFY_FETCHES](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Application/CoreServicesProvider.php#L705-L708) keeps PHP 7's string results from pdo_mysql. API output on 38 endpoints was identical with and without it. It is kept for internal comparisons and project hooks written against strings. - **Verify by hand:** only the arm64 image was built and tested. Before pushing the tag, build amd64 (Dokploy) and run a `php -v` and `/server/ping` check on it. - **Verify by hand:** sites with an auth secret shorter than 32 bytes return 500 "Provided key is too short" on login. Each consumer task checks and rotates its secret before switching image. - **Verify by hand:** the image is not published yet. After merge, run `docker login git.pienter.space`, then the buildx push in [README.md:215](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/README.md#L215). Check that the package is public with an anonymous `docker pull`. ## Review guide **1. Runtime image.** Directus 8 resolves its base path from `src/web.php`, so the core stays at the image's project root, and consumers copy their files into the same tree. - [Dockerfile:7](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/Dockerfile#L7) `runtime` stage: pinned `php:8.5.12-apache-trixie`, with the same extensions, Apache modules and `docker/` config as the AOS image. curl and mbstring are already built into the official image. - [Dockerfile:47-73](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/Dockerfile#L47-L73) final stage: `composer install --no-dev --optimize-autoloader`, without a classmap-authoritative autoloader, so consumer classes under `public/extensions/custom` still autoload through PSR-4. - [docker/php-directus.ini](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/docker/php-directus.ini): `display_errors=Off`, and deprecations go to the log. Without this, PHP 8.5 notices broke the JSON responses, including `/server/ping`. - **Check:** the uploads dirs under `public/uploads/_` are created and owned by `www-data`. Consumers with other paths (JVDV `jvdv-api`, TND `tnd`) must create their own. **2. PHP 8 breaks in the zend-db fork.** These are real 500s found on the AOS DB copy, not lint findings. - [packages/zend-db/src/Sql/AbstractSql.php:256-271](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/packages/zend-db/src/Sql/AbstractSql.php#L256-L271): `vsprintf` gets `(array)`, and `count` follows PHP 7 semantics for scalars and null. This fixed a `TypeError` on `items?meta=*` (`countByStatus`). - [packages/zend-db/src/Stdlib/PriorityList.php](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/packages/zend-db/src/Stdlib/PriorityList.php), copied from zend-stdlib 3.2.1, and [Update.php:15](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/packages/zend-db/src/Sql/Update.php#L15) now imports it, so the abandoned `zend-stdlib` dependency is gone. - `Sql/Ddl/Column/Float.php` is deleted: `Float` is a reserved class name, so the file could never load. It was the only lint fatal. - **Check:** the `count()` fallback (null → 0, scalar → 1) matches PHP 7.4 for every `$paramSpecs` key that reaches it. **3. PHP 8 breaks in the core.** - [src/core/Directus/Hook/Emitter.php:291-293](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Hook/Emitter.php#L291-L293): `call_user_func_array($listener, array_values($data))`. PHP 8 reads string keys as named arguments, which made `POST /_/files` fail with "Unknown named parameter $name". - [src/web.php:72-74](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/web.php#L72-L74): development mode no longer shows deprecations, so dev responses stay valid JSON. Production already reported nothing. - **Check:** a listener that relied on keys being passed positionally in their array order behaves the same. `array_values` keeps that order. **4. Dependencies.** `"php": "^8.5"`, plus Guzzle 6.5 → 7.16, symfony/validator 3.4 → 5.4, split `cache/*` 1.x adapters instead of the PHP 7-only monolith, ip-address-middleware 1.0 → 2.6, and the latest compatible minor everywhere else. - [composer.json:24](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/composer.json#L24) and [composer.json:91](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/composer.json#L91) (advisory policy). - **Check:** project hooks use Guzzle's `Client::post/request`, which is unchanged in 7. Anything relying on Guzzle 6 internals (`GuzzleHttp\Psr7\` functions) would break. **5. Token verification (security).** Upstream only base64-decoded several tokens and trusted their claims. A control run of the old code issued an admin token for a forged, unsigned SSO request token. - [AuthService.php:325-352](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Services/AuthService.php#L325-L352) `authenticateWithSsoRequestToken`: the public `POST /auth/sso/access_token` now verifies signature and expiry via `Provider::getTokenPayload` before issuing an access token for `$payload->id`. - [UsersService.php:296](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Services/UsersService.php#L296) `enableUserWithInvitation` and [AuthService.php:436](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Services/AuthService.php#L436) `resetPasswordWithToken`: same verification. A forged invite token used to activate a pending invite. - [AuthService.php:485](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Services/AuthService.php#L485) `refreshToken`: verifies first, so malformed tokens get 401 instead of a 500. - [Provider.php:658](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Authentication/Provider.php#L658) `getTokenPayload` is now public; it is the core's existing verify path (project secret, HS256, origin check). - **Check:** every token type keeps its type, origin and email checks after verification; expired tokens map to each endpoint's existing "expired" error. **6. Mail: Swift Mailer → Symfony Mailer.** Swift Mailer was abandoned in 2021. All sites will send through Amazon SES over SMTP, configured only through the existing `mail.default.*` keys / `DIRECTUS_MAIL_DEFAULT_*` env. - [Message.php:14](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Mail/Message.php#L14) `Message extends Email` and keeps the Swift-style setters hooks use (`setTo`, `setFrom`, `setReplyTo`, [setBody:97](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Mail/Message.php#L97), [addPart:123](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Mail/Message.php#L123)). - [SmtpTransport.php:27-34](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Mail/Transports/SmtpTransport.php#L27-L34): `ssl` = implicit TLS, `tls` = required STARTTLS. - [Mailer.php:87](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Mail/Mailer.php#L87): transport errors are logged and rethrown as `MailNotSentException`, so reset, invite and `/mail` no longer return the SMTP reply and username. - **Check:** project hooks calling Swift-only methods (`Swift_*` classes, Swift's `addTo($addr, $name)`) break. AOS's SES helper does; AOS-9 replaces it with the core helpers. **7. GraphQL removed.** Unused by the admin app and every frontend, and it carried three advisories with fixes only in graphql-php 15. - `src/endpoints/GraphQL.php`, `src/core/Directus/GraphQL/` (29 files), `GraphQLService`, the `/gql` route in `src/web.php` and its cache branch in `ResponseCacheMiddleware`. `/gql` answers 404. **8. php-jwt 7 and Phinx 0.16.** - [JWTUtils.php:30](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Util/JWTUtils.php#L30) decodes with `new Key($key, $alg)`; [:57](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Util/JWTUtils.php#L57) casts the payload to array (refresh passes a stdClass). Secrets must be ≥32 bytes. - [migrations/migrations.php:12](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/migrations/migrations.php#L12) feature flags and [InstallerUtils.php:736-737](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Util/Installation/InstallerUtils.php#L736-L737) collation keep Phinx 0.9's schema on fresh installs. Two upgrade migrations add `->save()` after `drop()`, which only queues since 0.10. - [CoreServicesProvider.php:155](https://git.pienter.space/pienter/directus-v8/src/commit/61f664a/src/core/Directus/Application/CoreServicesProvider.php#L155): Monolog 3 (forced by Phinx via psr/log 3) uses `Level::cases()`; log file names are unchanged. - **Check:** the fresh-install schema is byte-identical to the Phinx 0.9 image only for MariaDB 10.11; other servers weren't tested. **Skim:** - `app/` and the upstream example extensions removed (the old 2022 tree). - `packages/*/composer.json`: php constraint and explicit versions. - `packages/directus-*` (9 packages, 178 files) deleted: unused copies, not in composer repositories, require or autoload. - `composer.lock`, `.gitignore`, `.dockerignore`. - `README.md`: consumer contract, tag scheme `<directus>-php<php>[-r<n>]`, auth-secret rule, `## Mail` (env keys, SES, `Message` API), build and publish. - `AGENTS.md`, `ws.toml`, `docs/agents/issue-tracker.md`: Windshift `DI`. - `LICENSE.md`. ## Evidence **Before:** on PHP 8.5 without the fixes, `GET items/<collection>?meta=*` returned 500 (`TypeError` in `AbstractSql`) for `pages`, `header`, `top_header` and `Group_Training_Types`. `POST /_/files` returned 500 ("Unknown named parameter $name"). `/server/ping` responses carried deprecation notices. **After:** `git.pienter.space/pienter/directus-v8:8.8.1-php8.5.12`, built locally and run against a MariaDB 10.11 copy of the AOS database. `/server/info` reports PHP 8.5.12, Directus 8.8.1. Head 61f664a: smoke 77/77, smoke2 89/89 and flows 38/38, in production and development mode; the throwaway AOS consumer passes the same. First commit: 75/75 and 89/89. - **Covered:** - `/server/ping`, and the admin app with its static assets. - Login, wrong password and refresh; 21 admin bootstrap endpoints. - 25 public collection reads, and public denial of `Contact_Form_Responses` and `directus_users`. - Public contact form create. - Item edit with revision and revert. - Multipart upload with thumbnails and `/_/assets`; an existing AOS media thumbnail. - Filters, sort, meta and batch PATCH; `/gql` → 404. - Schema paths: create collection, add FLOAT, ALTER, drop. - CLI `db:upgrade` on the AOS copy: applies nothing. - Fresh install (`install:database`, `install:install`) on an empty MariaDB: schema, system data and 79 migration rows identical to the Phinx 0.9 image; the full upgrade path too. - Mail via Mailpit with STARTTLS required and SMTP auth: reset and invite mails with the right from/to/subject and token in the HTML. - Tokens: login, refresh, reset, invite. Forged SSO, invite and reset tokens (bad signature, wrong secret, `alg: none`, wrong type, signed but expired) → 401 with each endpoint's existing error, and no state change. Garbage refresh tokens → 401. - Wrong SMTP password: reset, invite and `/mail` return the generic 503 mail error with no SMTP text; the log has the TransportException. - Control run with the old `AuthService`: forged SSO tokens got **200 with an admin token** (35/38), so the tests catch the hole. - A throwaway consumer (`FROM` this tag plus AOS's `config/` and `public/extensions/custom`) passes the same sets. AOS's custom `mail` endpoint, its SES contact hook and its Dokploy rebuild hook all loaded and ran up to their missing env vars. - **Checks:** - `docker build` succeeds. - `php -l` on 2921 PHP files: 0 failures. - `composer validate` valid (alias and `@dev` path warnings); `composer audit` lists only the ignored flysystem advisory. - Runtime error log: 0 fatals, and one pre-existing `E_WARNING` (`src/helpers/file.php:138` undefined `private_hash`, a notice on 7.4). - The container healthcheck reports healthy. - **Not covered:** real SES delivery and frontend rebuilds (project-specific), the real OAuth SSO callback (no provider configured; a validly signed request token was minted the way the core does), the amd64 build, and `install:config` on a fresh checkout (it fails the same way on 7.4). **Tests:** none in the repo; the smoke scripts were throwaway. ## Merge Danger **Door:** two-way Merging publishes nothing and deploys nothing. The image push is a separate manual step, and no site uses this repo yet. **Blast Radius:** none-yet Once AOS-9, JVDV-10 and DVPL-2 build `FROM` the tag, a defect here reaches all three sites. The image breaks AOS's Swift-based contact notification and short auth secrets, so each site moves only together with its consumer task. Tags are immutable (`-r<n>` for rebuilds), so each site can pin back to the tag it used before.
php2shell (CVE-2026-109618, CVE-2026-109619) is fixed in PHP 8.5.12, and
PHP 7.4 gets no patch. Replace the 2022 tree with the AOS core and build
it as a public base image on php:8.5.12-apache-trixie, which consumer
projects build FROM with only their config, custom extensions, env and
upload paths.

- Bump Guzzle to 7, symfony/validator to 5.4, split cache/* adapters,
  ip-address-middleware 2.6, and everything else to the latest
  compatible minor. Keep phinx 0.9, swiftmailer 5, graphql-php 0.13 and
  php-jwt 5, ignoring their unfixable advisories by ID with reasons.
- Fix PHP 8 breaks: zend-db vsprintf/count TypeError on meta=*, hook
  emitter named-argument error on file upload, reserved Float class;
  copy PriorityList into the zend-db fork and drop zend-stdlib.
- Keep PHP 7 string fetch results from pdo_mysql and keep deprecation
  notices out of responses.
- Document the consumer contract and tag scheme in the README; add the
  Windshift tracker docs.

Refs: DI-1
Mail goes through symfony/mailer 7.4 behind the existing Directus mail
config; Directus\Mail\Message is a Symfony Email that keeps the Swift
style setters hooks use. The core mailer logs transport errors and throws
MailNotSentException, so password reset, invitations and /mail answer
with the generic 503 error and never return the SMTP reply or username.

The GraphQL endpoint and graphql-php are removed (/gql answers 404).
php-jwt 7 requires a >=32 byte auth secret. Phinx 0.16 runs with feature
flags and collation that keep the 0.9 schema; it needs Monolog 3
(psr/log 3) and psr/simple-cache 2, aliased for cache 1.x. The unused
packages/directus-* copies are deleted and stale advisory ignores dropped.

SSO request, invitation and password-reset tokens are now verified with
the project secret before their claims are trusted. Upstream only decoded
them, so a forged unsigned token could log in as any user through
POST /auth/sso/access_token or activate a pending invite. Refresh verifies
first too, so malformed tokens get the invalid-token error, not a 500.

Refs: DI-1
pienter deleted branch feature/DI-1-port-directus-8-core-to-php-85-and-publish-base-im 2026-10-23 15:04:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pienter/directus-v8!1
No description provided.