Automattic / Automattic/workspace

Harden pasted image validation and size limits

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Summary
Pasted images in the WordPress Agent composer should be validated before they become pending attachments.

## Follow-ups
- Add a maximum accepted pasted image size for raw pasteboard bytes and copied image files.
- Decode/validate raw image pasteboard bytes before writing them into the pending attachment flow.
- Show a clear user-facing error when a pasted image is too large or not decodable.
- Keep normal text paste behavior unchanged when the clipboard is not an image.

## Context
The current implementation supports pasted image file URLs and raw image data, but it does not enforce size limits or fully validate raw bytes before creating temp files.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in the WordPress Agent composer’s pasted-image handling and trace both image file URLs and raw image data through the pending attachment flow. Verify size and decodability before temporary files are created, preserve normal text pasting, and confirm that oversized or invalid images show a clear user-facing error.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift, wordpress
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.