microsoft / microsoft/skill-recorder
[Medium] Analysis edits are persisted without validating the payload shape
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4k
- Forks
- 413
- Avg merge
- 3h 16m
- Merged PRs (30d)
- 10
Description
Severity
Medium — untrusted-shape data persisted and consumed downstream without validation.
Location
electron/ipc.ts:173(updateAnalysishandler) validates onlyinput.sessionId; it forwardstitle/intent/stepsunchecked.electron/describer/describer.ts:142(edit) persists the edited analysis.
Mechanism
The renderer-supplied steps (and title/intent) are written to the persisted analysis with no schema validation of the array/step shape. Malformed or partial structures reach bundle/builder consumers that assume a well-formed Analysis.
Impact
A malformed edit can corrupt the persisted analysis and cause downstream builder failures or bad output — and, because it's persisted, the corruption survives restarts.
Suggested fix
Validate the payload against the Analysis/step schema (types, required fields, step shape) in the handler or in describer.edit before persisting; reject with a clear error otherwise.
Regression test to add (npm test)
Unit test updateAnalysis/edit with a malformed payload (missing/typo'd step fields); assert it's rejected and nothing is persisted. Deterministic; the evals/ suites score model output, not this IPC validation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in electron/ipc.ts at the updateAnalysis handler and then read electron/describer/describer.ts around edit. Trace the Analysis and step shapes used before persistence, then run npm test with a malformed payload such as a step missing required fields. Done means the payload is rejected and the edited analysis is not persisted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, typescript
- Domain
- desktop, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100