Skip to content

Release prefixed request signing for SHA-256-restricted Auth Keys #69

Closed

Description

@kvz

Developers installing the published Composer version 3.3.0 cannot authenticate requests with an Auth Key that requires at least SHA-256. The SDK emits an unprefixed SHA-1 HMAC and exposes no released algorithm option, so even accepting stronger request algorithms server-side cannot make these requests valid.

The released TransloaditRequest::signString returns hash_hmac('sha1', $string, $this->secret). An offline invocation with a synthetic secret matches SHA-1 exactly and contains no algorithm prefix. This is independent of HTTP transport and does not require a production request.

Main already contains the implementation in #63, with the PHP 7.4 compatibility work in #67. This issue tracks the gap between that code and the published Composer package, rather than requesting duplicate implementation.

Proposed patch / acceptance sketch:

  • Retain the merged configurable signing path: compute the HMAC over the exact serialized params, return algorithm:hex, and pass the configured algorithm through every request.
  • Verify the public signing API and the actual outgoing request with a recording transport: default prefixed SHA-384; explicit SHA-256; explicit legacy SHA-1; invalid algorithms fail clearly. Compare with independent hash_hmac calls using synthetic credentials. Cover the supported PHP runtime floor with the repository’s unit tests.
  • Keep Smart CDN URL signing and webhook verification unchanged. Document the compatibility effect: changing the request default from SHA-1 can reject requests made with an older key that requires exactly SHA-1 until the corresponding server compatibility policy is available; an explicit legacy override remains useful.
  • A maintainer must approve the default/compatibility decision and choose the version and release timing. This issue does not authorize tagging or publishing a release.

🤖 Claimed by kvz on framework1/php-sdk since 2026-11-18 · resume: codex resume 01a1ed8d-bfa3-7ee3-827f-3450a5929dbf

Activity

  1. self-assigned this
    on Nov 14, 2026
  2. kvz commented on Nov 18, 2026

    @kvz
    MemberAuthor

    Release preflight supports 3.4.0: the API-compatible request-signing default changes to prefixed SHA-384, with an explicit legacy SHA-1 override and the PHP 7.4 runtime floor retained. There are eight commits since v3.3.0.

    Two release-process details need clarification before publishing:

    • An unpublished v3.4.0 draft already exists, created on 2026-04-27 and targeting main. No v3.4.0 tag exists locally or remotely.
    • CONTRIBUTING.md says publishing a release triggers the release workflow, but .github/workflows/ci.yml is the only checked-in workflow and only runs on main pushes and pull requests. There is no release-triggered workflow.

    Paused at preflight, before tests, dependency installation, release-file edits, commits, tagging, registry notification, or publication. Packagist still lists 3.3.0 as the latest release. No release state has been changed; the checkout remains clean on main. This issue remains open until the package is delivered and verified.

  3. kvz commented on Nov 18, 2026

    @kvz
    MemberAuthor

    Released v3.4.0: https://github.com/transloadit/php-sdk/releases/tag/v3.4.0

    Request signatures now default to prefixed SHA-384 (sha384:...), so Auth Keys requiring at least SHA-256 can authenticate. The configurable SHA-256 and legacy SHA-1 overrides remain available.

    Verification:

    • Docker lint and all 39 unit/system tests passed with Node parity enabled; make test also passed after updating the release metadata (30 tests, 117 assertions).
    • All seven PHP CI configurations passed, including PHP 7.4: https://github.com/transloadit/php-sdk/actions/runs/44260068724
    • Tag v3.4.0 points to release commit 0698e27
    • Packagist notification succeeded, and its public package metadata lists 3.4.0 at that commit.
    • A fresh composer require transloadit/php-sdk:^3.4 installed 3.4.0. Offline checks verified the prepared request's prefixed SHA-384 HMAC, SHA-256 and SHA-1 overrides, and rejection of unsupported algorithms, without calling the API.

    The existing draft was published as the single v3.4.0 release. The package is delivered and this issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions