a2ui-project / a2ui-project/a2ui
[BUG]: v0_8 read path resolves JSON pointers through ordinary-object prototype chains
- Vorherrschende Sprache
- TypeScript
- Sterne
- 16.4k
- Forks
- 1.3k
- Ø Merge
- 3 T. 15 Std.
- Gemergte PRs (30 T.)
- 134
Beschreibung
# 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.
Beitragsleitfaden
Rechercherichtung
Das Problem liegt im Lesepfad des v0_8-Modellprozessors, insbesondere in `model-processor.ts` in den Zeilen 356-377. Untersuche zunächst, wie `current[segment]` Eigenschaften auflöst. Die Korrektur umfasst wahrscheinlich die Verwendung von `Object.prototype.hasOwnProperty`, um vor dem Zugriff zu prüfen, ob es sich um eigene Eigenschaften handelt, oder den Wechsel zu einer auf Map basierenden Speicherung, die dem Schreibpfad entspricht. Führe die vorhandenen Tests aus, um sicherzustellen, dass die Korrektur keine bestehende Funktionalität beeinträchtigt, und überprüfe, dass geerbte Eigenschaften wie `toString` über vom Agenten bereitgestellte Pfade nicht mehr zugänglich sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- security
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 65/100