GHSA-PHW2-HP8R-HG3G
Authentication Bypass on `/skServer/inputTest` due to Route Prefix Mismatch
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 2.32.0 | signalk-server · -1 d desde divulgación | |
| Divulgación | Publicada | GHSA-PHW2-HP8R-HG3G divulgada · CVSS 6.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
A route prefix mismatch in `src/tokensecurity.ts` causes the `http_authorize` middleware to be registered for
`/skServer/skServer/inputTest` instead of `/skServer/inputTest`. As a result, the `POST /skServer/inputTest`
endpoint remains unprotected by authentication middleware.
### Details
In `src/tokensecurity.ts` (introduced during the refactoring in commit `287b15ed`):
```typescript
const SERVERROUTESPREFIX = '/skServer'
;[
'/apps',
...
'/hasAnalyzer',
'/skServer/inputTest' // <-- Redundant prefix
].forEach((p) =>
app.use(`${SERVERROUTESPREFIX}${p}`, http_authorize(false))
)
Because ${SERVERROUTESPREFIX} (/skServer) is prepended to each element, the route is registered as
/skServer/skServer/inputTest.
However, src/interfaces/playground.js registers the route as:
app.post(`${serverRoutesPrefix}/inputTest`, (req, res) => { ... })
Consequently, POST /skServer/inputTest is never guarded by http_authorize(false). Furthermore, when a request is
sent without sendToServer or sendToN2K (or set to false), the inner allowConfigure authorization check is bypassed:
if (
(sendToServer || sendToN2K) &&
!app.securityStrategy.isDummy() &&
!app.securityStrategy.allowConfigure(req)
) {
res.status(400).json({ error: 'permission denied' })
return
}
This allows unauthenticated remote callers to execute the underlying NMEA parser engines without any credentials.
Additionally, diagnostic endpoints in src/serverroutes.ts (/skServer/nodeInfo, /skServer/debugKeys, and
/skServer/paths) lack authentication middleware coverage.
Steps to Reproduce
Even when security is enabled on the server, send a request without any authentication tokens:
curl -X POST http://localhost:3000/skServer/inputTest \
-H "Content-Type: application/json" \
-d '{"value": "$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47", "sendToServer": false}'
• Expected behavior: Returns 401 Unauthorized.
• Actual behavior: Returns 200 OK with parsed delta payload without requiring any authentication.
Impact
• Unauthenticated access to the /skServer/inputTest parser endpoint.
• Unauthenticated exposure of system diagnostics and registered metadata paths.
Proposed Fix
Remove the redundant prefix in src/tokensecurity.ts and add the unprotected diagnostic routes:
--- a/src/tokensecurity.ts
+++ b/src/tokensecurity.ts
@@ -771,7 +771,10 @@ function tokenSecurityFactory(
'/webapps',
'/availablePaths',
'/hasAnalyzer',
- '/skServer/inputTest'
+ '/inputTest',
+ '/nodeInfo',
+ '/debugKeys',
+ '/paths'
].forEach((p) =>
app.use(`${SERVERROUTESPREFIX}${p}`, http_authorize(false))
)
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmsignalk-server |
Corregida | 2.32.0 | -1 d | 2.37.0 no afectada |
2.32.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/SignalK/signalk-server/security/advisories/GHSA-phw2-hp8r-hg3gLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
