Skip to content

Prevent expired-token replay on v3 upload endpoints - #5617

Merged
serdarozerr merged 2 commits into
mainfrom
fix/upload-token-relaxation
Nov 4, 2026
Merged

serdarozerr merged 2 commits into
mainfrom
fix/upload-token-relaxation

Conversation

@serdarozerr

Copy link
Copy Markdown
Contributor

The middleware read upload_start_time from Rack params, which merges query string and POST body. A client could supply a backdated value via query string (?upload_start_time=) to shift the token-expiry reference time, allowing an expired token to pass auth on the v3 package, buildpack, and droplet upload endpoints.

Additionally, a missing param caused nil.to_i == 0 which is truthy in Ruby, so the relaxed decoder was always constructed with reference time 0 (Unix epoch), accepting any token with exp > 0.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

The middleware read upload_start_time from Rack params, which merges query string and POST body. A client could supply a backdated value via query string (?upload_start_time=<past>) to shift the token-expiry reference time, allowing an expired token to pass auth on the v3 package, buildpack, and droplet upload endpoints.

Additionally, a missing param caused nil.to_i == 0 which is truthy in Ruby, so the relaxed decoder was always constructed with reference time 0 (Unix epoch), accepting any token with exp > 0.
@serdarozerr
serdarozerr merged commit d0a3d3d into main Nov 4, 2026
11 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Nov 4, 2026
Changes in cloud_controller_ng:

- Prevent expired-token replay on v3 upload endpoints
    PR: cloudfoundry/cloud_controller_ng#5617
    Author: serdar özer <serdarozer14@gmail.com>
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