adapter-stellar: the xdr-json WASM is fetched from unpkg and run with no integrity check
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript, wasm
- Área
- blockchain, security
Línea de trabajo
Start in packages/adapter-stellar/src/sac/xdr.ts, especially the CDN URL and init(CDN_WASM_URL) calls, and read the comment at the top of the file. Compare the options in the issue against the package version range and existing SAC load error handling. Done means the chosen approach prevents unverified WASM from running and reports failures through the SAC load error with the reason on cause.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
To load a Stellar Asset Contract, the adapter encodes the SAC spec with @stellar/stellar-xdr-json, whose WASM is not bundled. It is fetched at run time from https://unpkg.com/@stellar/stellar-xdr-json@<installed version>/stellar_xdr_json_bg.wasm and instantiated as served: sac/xdr.ts L28-L30 (the URL) and L53 (init(CDN_WASM_URL)).
Nothing checks that the bytes are the ones published for that version. The version in the URL follows the installed package, but the content is not verified.
Why it matters
- The app runs code from a third-party CDN in the user's browser, in the same page that builds and signs transactions. If unpkg, or anything on the path to it, serves different bytes, the adapter runs them.
- The WASM produces the SAC interface the app shows and encodes against, so a wrong module can change which functions and argument types a user sees for a token contract.
- Availability is a separate, smaller point: if unpkg is down or blocked by a Content Security Policy, SACs do not load. That already fails with a clear error and is not what this issue is about.
Suggested fix
Options, to be weighed by whoever picks this up:
- Verify before instantiating: fetch the bytes, compare their SHA-256 with a hash the adapter ships for that package version, and refuse on mismatch. The adapter depends on a version range, so it needs either a hash per known version (and a decision on what an unknown version does) or an exact pin.
- Let the consumer supply the WASM (a URL or the bytes), so an app can host it under its own policy. This also helps strict-CSP apps.
- Bundle the WASM. Ruled out so far for bundle size and bundler compatibility (see the comment at the top of
xdr.ts); listed for completeness.
Whichever is chosen, a failed check should surface as the existing SAC load error, with the reason on cause.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 2
- Merge medio
- 6 h 33 min
- PR fusionados (30 d)
- 11
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 OpenZeppelin/openzeppelin-adapters
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
OpenZeppelin/openzeppelin-adapters#114 ·
Los mantenedores suelen responder en 1 día
-
Stellar RPC settings: placeholder shows a non-working URL, and the field can't be left emptyAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
OpenZeppelin/openzeppelin-adapters#90 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
OpenZeppelin/openzeppelin-adapters#72 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OpenZeppelin/openzeppelin-adapters#47 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 54/100
OpenZeppelin/openzeppelin-adapters#115 ·
Los mantenedores suelen responder en 1 día
Todos los issues de OpenZeppelin/openzeppelin-adapters
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
提出物確認の詳細で状態バッジの重複と期限切れの欠落を直すAbiertoCodex使用可 かんたん コード
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ryuki-moro/Nicomaru#348 ·
Los mantenedores suelen responder en 1 día
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:crash-loop issue-rating: 🦞 diamond lobster P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openclaw/openclaw#211919 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día