Skip to content

fix(utils): improve robustness of frame messenger and string processing#5082

Open
RinZ27 wants to merge 2 commits intodequelabs:developfrom
RinZ27:fix/frame-messenger-robustness
Open

fix(utils): improve robustness of frame messenger and string processing#5082
RinZ27 wants to merge 2 commits intodequelabs:developfrom
RinZ27:fix/frame-messenger-robustness

Conversation

@RinZ27
Copy link
Copy Markdown
Contributor

@RinZ27 RinZ27 commented Apr 27, 2026

Strengthening the robustness of internal utilities ensures better stability across different environments. While reviewing the core library, I noticed several areas where string processing and frame communication could be more resilient against unexpected input.

Addressing potential logic errors in process-message.js, this update introduces proper regex escaping for property names. I encountered a case where special characters in metadata could interfere with the template substitution, so centralizing the escaping logic was a priority.

Updating the frame messenger's channel-store.js adds a necessary layer of validation for channelId. Ensuring only string identifiers are processed helps maintain the integrity of communication channels between frames. Additionally, I modified uuid.js to safely detect the crypto API, preventing crashes in environments where window is unavailable, such as Node.js or Web Workers.

Refining get-friendly-uri-end.js extends the ignored schemes to include vbscript: and file:. These changes collectively improve the engine's correctness when handling diverse URI formats in a security-conscious manner.

Validation of these fixes was performed locally to confirm that the existing test suite remains stable and the reported edge cases are now correctly handled.

RinZ27 added 2 commits April 27, 2026 09:55
I switched to Object.create(null) for the channel store and added explicit checks for restricted keys like __proto__ to ensure robust cross-frame communication.
- Escaped property names in process-message to prevent regex injection and logic errors.
- Added vbscript: and file: to ignored URL schemes in getFriendlyUriEnd.
- Hardened channelId validation in channel-store to avoid potential hijacking.
- Improved crypto detection in uuid.js to support Node.js and Web Workers safely.
@RinZ27 RinZ27 requested a review from a team as a code owner April 27, 2026 03:11
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