Joystream / Joystream/audits

No deposit is charged for creating forum posts and threads

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S2 - moderate
Dominant language
No language data
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Summary

In the forum module, it is possible for users to create threads and posts without paying any deposit or burning additional funds. This has two consequences:

  1. It allows attackers to fill the blockchain storage at very little cost
  2. It allows an attacker to create a lot of posts in a certain thread, exhausting the MAXIMUM_POSTS limit. As a result, the attacker can prevent other users from creating posts and in effect perform a Denial of Service attack against the forum.

Requiring a deposit for a thread and a forum post would mitigate this issue.

Issue

The forum module allows users to create threads and add posts to them. Both of those operations result in a storage write to the on-chain storage. Note that this storage write is only of a fixed size, since the post text and post/thread title is hashed. The forum module does not require any deposit for creating threads or posts.
This has the following consequences:

  1. It allows attackers to fill the blockchain storage at very little cost, by creating a lot of threads/posts.
  2. It allows an attacker to create a lot of posts in a certain thread, exhausting MaxPostsInThread limit. As a result, the attacker can prevent other users from creating posts and in effect perform a Denial of Service attack against the forum. In the same vein, an attacker could exhaust the MaxThreadsInCategory limit for a certain Category.

Since any forum user can create threads and posts, this attack can be carried out by any forum user.

Note that forum posts and threads can be deleted, but this requires additional work from a moderator/working group lead.

Risk

This issue would allow an attacker to fill up the blockchain storage by creating a lot threads and posts. A full storage is problematic because it could lead to an infeasible amount of storage being required to run a blockchain node.

Since the posts and threads only require a fixed size on-chain and can be deleted by a forum moderator/working group lead, this issue is only of moderate severity.

Mitigation

We suggest to require deposit for forum posts/threads that will be frozen for a certain amount of time. If a moderator does not "reject" the posts and/or threads created, the deposit should be unfrozen. If a post/thread is rejected, the deposit should be burned.
By introducing a deposit for posts/threads, Joystream can also remove the MaxPostsInThread and MaxThreadsInCategory limit.

Another way to mitigate this issue is to require the user to burn some money every-time a thread or post is created, similar to way burning a certain stake is required when buying a membership.

Mitigating this issue will also help mitigating issue #6.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the forum module's thread and post creation paths and the MaxPostsInThread and MaxThreadsInCategory checks described here. Define and verify the deposit or burn behavior for accepted and rejected content, ensuring storage abuse and denial-of-service risks are addressed without relying on moderator deletion.

Written by the indexing model from the issue text.

Assessment

Domain
blockchain
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.