Skip to content

security: add update size limits to prevent DOS attacks#688

Open
gvergnaud wants to merge 1 commit into
yjs:mainfrom
gvergnaud:main
Open

security: add update size limits to prevent DOS attacks#688
gvergnaud wants to merge 1 commit into
yjs:mainfrom
gvergnaud:main

Conversation

@gvergnaud

@gvergnaud gvergnaud commented Jan 9, 2025

Copy link
Copy Markdown

Resolves #687

Comment thread src/utils/limits.js
Comment on lines +1 to +4
export const MAX_STRUCTS = 100_000
export const MAX_UPDATES = 100_000
export const MAX_GC_LENGTH = 100_000
export const MAX_SKIP_LENGTH = 100_000

@gvergnaud gvergnaud Jan 9, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These limits are totally arbitrary, I don't know what numbers would make sense here.

Another approach I thought about was to increment a loop counter, and use the same limit for structs and updates. It might be preferable because 100_000**2 = 10B loops is also too many. I don't think this would work for GC and skip item lengths, though.

Happy to iterate on the solution!

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.

Denial of Service vulnerability: run-length encoding can be exploited to lock JS threads

1 participant