8000 security: add update size limits to prevent DOS attacks by gvergnaud · Pull Request #688 · yjs/yjs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gvergnaud
Copy link
@gvergnaud gvergnaud commented Jan 9, 2025

Resolves #687

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
Copy link
Author
@gvergnaud gvergnaud Jan 9, 2025

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
0