a2ui-project / a2ui-project/a2ui

[BUG]: v0_8 read path resolves JSON pointers through ordinary-object prototype chains

Chiusa
#2,299 2 commenti 0 reazioni 1 assegnatario Rivendicata da @Varun-S10 Vedi su GitHub
P2 status: first-line-handled status: needs review type: bug
Lingua principale
TypeScript
Stelle
16.4k
Fork
1.3k
Merge medio
3g 15h
PR unite (30g)
134

Descrizione

# v0_8 read path resolves JSON pointers through ordinary-object prototype chains

Repository: https://github.com/a2ui-project/a2ui
Affected: `@a2ui/web_core` v0_8 processing
CWE: CWE-200 (Exposure of Sensitive Information — read-path traversal)

## Summary

The v0_8 model processor resolves JSON Pointer reads by walking plain objects (`current[segment]`, `model-processor.ts:356-377`). Properties inherited through the prototype chain (e.g. `Object.prototype` built-ins) are therefore reachable by agent-supplied paths.

Notes on scope:

- The v0_8 **write** path is Map-based and unaffected.
- The v0_9 path rejects dangerous keys (`__proto__`/`constructor`/`prototype`) after unescaping.

## Impact

Agent-supplied paths may resolve to inherited values (e.g. a `toString` function) instead of data-model values, causing unexpected types to flow into bindings and expression evaluation. No modification/write primitive was found — this is read-path behavior only.

## Suggested remediation

Resolve reads with `Object.prototype.hasOwnProperty` checks, or store values in Maps consistent with the write path.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Il problema si trova nel percorso di lettura del processore di modelli v0_8, nello specifico in `model-processor.ts`, alle righe 356-377. Inizia esaminando come `current[segment]` risolve le proprietà. La correzione probabilmente comporta l'uso di `Object.prototype.hasOwnProperty` per verificare che le proprietà siano proprie prima di accedervi, oppure il passaggio a uno storage basato su Map coerente con il percorso di scrittura. Esegui i test esistenti per assicurarti che la correzione non interrompa le funzionalità esistenti e verifica che le proprietà ereditate, come `toString`, non siano più accessibili tramite percorsi forniti dall'agente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
65/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.