storage: V4 getSignedUrl sorts canonical headers with localeCompare, so they disagree with X-Goog-SignedHeaders
Los mantenedores suelen responder en 1 día
@itsrayeedscodespace ya está trabajando en esto.
Desde el 8/11/2026.
- #9841 de @itsrayeedscodespace — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
Línea de trabajo
Empieza en handwritten/storage/src/signer.ts, en URLSigner.getCanonicalHeaders, y compara el orden de las cabeceras con el .sort() simple que se usa para signedHeaders. Comprueba si las pruebas del firmante de storage cubren nombres de cabecera que contienen - y _, y el orden sensible a la configuración regional. La tarea está terminada cuando el bloque de cabeceras canónicas sigue el orden de los puntos de código y coincide con la lista de cabeceras firmadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
- Check the API's issue tracker: https://cloud.google.com/support/docs/issue-trackers
Library Name
@google-cloud/storage
A screenshot that you have tested with "Try this API".
Not applicable: V4 URL signing happens entirely in the client library; no API call is involved.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/trackoor/dc977f474cf9a692628c158959bbef2c
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
npm install(installs @google-cloud/storage 8.4.0), Node.js v26.13.0 (full ICU), Linux.node index.jsprints the canonical request that gets signed, forextensionHeaders: {"x-goog-meta-a_b": "1", "x-goog-meta-a-b": "2"}:
GET
/test-bucket/test-object
X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=test%40example.iam.gserviceaccount.com%2F20261107%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20261107T105715Z&X-Goog-Expires=60&X-Goog-SignedHeaders=host%3Bx-goog-meta-a-b%3Bx-goog-meta-a_b
host:storage.googleapis.com
x-goog-meta-a_b:1
x-goog-meta-a-b:2
host;x-goog-meta-a-b;x-goog-meta-a_b
UNSIGNED-PAYLOAD
LANG=lt_LT.UTF-8 node index.js ltdoes the same forx-goog-meta-yandx-goog-meta-j:
host:storage.googleapis.com
x-goog-meta-y:1
x-goog-meta-j:2
host;x-goog-meta-j;x-goog-meta-y
A clear and concise description of what the bug is, and what you expected to happen.
The canonical headers block is in a different order from the signed headers list in the same canonical request, so GCS computes a different signature and rejects the URL. Expected: canonical headers in code point order, matching X-Goog-SignedHeaders:
host:storage.googleapis.com
x-goog-meta-a-b:2
x-goog-meta-a_b:1
host;x-goog-meta-a-b;x-goog-meta-a_b
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
The V4 canonical request docs say headers are sorted by name "using a lexicographical sort by code point value": https://cloud.google.com/storage/docs/authentication/canonical-requests
URLSigner.getCanonicalHeaders in handwritten/storage/src/signer.ts (line 401 on main at 97b0d64daa8ea9407756aee646b8ac1bf19aec80) sorts with a[0].localeCompare(b[0]), which puts _ before - and follows the process locale, while signedHeaders uses a plain .sort().
Credit: https://ucsbplse.github.io/
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.2k
- Forks
- 732
- Merge medio
- 3 d 7 h
- PR fusionados (30 d)
- 117
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleapis/google-cloud-node
-
Broken deprecation chainAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
googleapis/google-cloud-node#9854 ·
Los mantenedores suelen responder en 1 día
-
pubsub: "Operation attempted on ended Span" when a modack is flushed after the message was ackedAbiertoapi: pubsub
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
googleapis/google-cloud-node#9853 ·
Los mantenedores suelen responder en 1 día
-
firestore: getPartitions() emits gax AutopaginateTrueWarning in every processPosiblemente ocupada @TheRealDanii la tomó hace 9 días. Abiertoapi: firestore
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
googleapis/google-cloud-node#9736 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
googleapis/google-cloud-node#9723 ·
Los mantenedores suelen responder en 1 día
-
spanner: requiring @google-cloud/spanner stops the process from exiting on SIGTERM/SIGINTQuizá libre de nuevo @alkatrivedi la tomó hace 31 días y no hay ningún pull request abierto. Abiertoapi: spanner
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleapis/google-cloud-node#9513 · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de googleapis/google-cloud-node
Issues similares
-
bug UI
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
wardian-app/Wardian#1746 ·
Los mantenedores suelen responder en 1 día
-
area: interop area: sip-core v3
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
fonoster/routr#705 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
openclaw/openclaw#198551 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día