Skip to content

fix(security): address security review findings - #10

Open
Chris-Moller wants to merge 13 commits into
mainfrom
agent/1f835417-2111-44a1-8917-4c062d8dacdb
Open

fix(security): address security review findings#10
Chris-Moller wants to merge 13 commits into
mainfrom
agent/1f835417-2111-44a1-8917-4c062d8dacdb

Conversation

@Chris-Moller

Copy link
Copy Markdown
Contributor
  1. scrollback buffer uses unbounded memory — cap at configured limit. 2. getScrollbackLines() returns a mutable reference to the internal array.

Venice Executor and others added 13 commits March 19, 2026 09:17
1. Cap scrollbackLines to MAX_SCROLLBACK (10000) to prevent unbounded memory growth
2. Return shallow copies of cells and scrollback arrays from getState() to prevent
   external mutation of internal terminal state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… leaks

The previous fix used row.slice() which only shallow-copies the array,
leaving cell objects as shared references. External code could still
mutate internal terminal state through the returned cells. Now uses
deep copy that clones both cell chars and attr objects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… nested attr colors

- scrollbackLines is now a getter/setter that enforces MAX_SCROLLBACK cap,
  preventing bypass via direct property assignment after construction
- All attr copies now use deepCopyAttr() which properly clones nested
  fg/bg color objects ({type:'256',value} and {type:'rgb',r,g,b}),
  closing the remaining mutable reference leak

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… resize

- Add getScrollbackLines() method that returns a deep-copied scrollback array
- Enforce scrollback cap in resize() to prevent unbounded growth
- Trim scrollback in scrollbackLines setter when cap is reduced

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant