Title: fix(uploads): sign Azure upload URLs create-only by waleedlatif1 · Pull Request #6607 · simstudioai/sim · GitHub
Open Graph Title: fix(uploads): sign Azure upload URLs create-only by waleedlatif1 · Pull Request #6607 · simstudioai/sim
X Title: fix(uploads): sign Azure upload URLs create-only by waleedlatif1 · Pull Request #6607 · simstudioai/sim
Description: Summary getBlobPresignedUploadUrl signed its SAS with BlobSASPermissions.parse('w'). Per Azure's service-SAS reference, w is "Create or write content, properties, metadata, or block list" — it permits overwriting an existing blob. c is "Write a new blob" and does not. origin/main signed c before this signer moved out of core/storage-service.ts, so Azure deployments lost create-only enforcement in the move. The If-None-Match: '*' the signer returns cannot carry the guarantee on its own. An Azure service-SAS string-to-sign covers the resource, times, permissions and the five rsc* response-header overrides — never request headers — so a client is free to drop it. The header is signed on the other two providers (inside the PutObjectCommand on S3; as x-goog-if-generation-match in signed extensionHeaders on GCS), which is why only Azure regressed. Without this, a signed upload URL stayed a plain overwrite grant on the final key for its full UPLOAD_URL_TTL_MS hour. A caller could replace the object after complete had verified size and content type, written the workspace file row and metered storage from that verified HEAD — leaving durable metadata and billing describing content that no longer exists, and the replacement never re-metered. The multipart block-staging signer keeps w: block staging is legitimately overwrite-shaped and matches main. One doc sentence corrected: it credited If-None-Match with preventing overwrite. The header is still sent (so it stays in the CORS allowlist), but the signature is what enforces create-only. Azure-backed deployments only. S3 and GCS were already correct and are untouched. Type of Change Bug fix Testing bun run type-check clean, 694 tests pass across lib/uploads + app/api/files, bun run lint and bun run check:api-validation pass. The existing test asserted parse('w'), so it actively locked the defect in. It now asserts create-only, and its name states the guarantee — so a future flip back reads as deleting a security property rather than adjusting a value. Verified it fails when the permission is reverted. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary getBlobPresignedUploadUrl signed its SAS with BlobSASPermissions.parse('w'). Per Azure's service-SAS reference, w is "Create or write content, properties, metadata, or blo...
X Description: Summary getBlobPresignedUploadUrl signed its SAS with BlobSASPermissions.parse('w'). Per Azure's service-SAS reference, w is "Create or write content, properties, ...
Opengraph URL: https://github.com/simstudioai/sim/pull/6607
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bb1cf673-507f-1e9e-09d6-ae8424d203b7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C7A6:18732E:9CFAED:D7B637:6AFB4DA4 |
| html-safe-nonce | 2d7b7e88051101eaada37c176226baf3500f040bf9d0982df0ba3e36f4505eca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0E2OjE4NzMyRTo5Q0ZBRUQ6RDdCNjM3OjZBRkI0REE0IiwidmlzaXRvcl9pZCI6IjU5MDE2NDM5NzExNDU5NzcyNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | dbc8b7b439aec413f7809e67b5c1f1a246475afaadf98fb84b82934f776e4163 |
| hovercard-subject-tag | pull_request:4259599543 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6607/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary getBlobPresignedUploadUrl signed its SAS with BlobSASPermissions.parse('w'). Per Azure's service-SAS reference, w is "Create or write content, properties, metadata, or blo... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 26504db649b58525278f77a52b80ba5f10d5f4de |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width