HackMD
  • New!
    New!  Markdown linter lands.
    Write with consistency! Enable markdown linter that hints better markdown styling you can take. Click the lightbulb on the editor status bar 💡
    Got it
      • Create new note
      • Create a note from template
    • New!  Markdown linter lands.
      New!  Markdown linter lands.
      Write with consistency! Enable markdown linter that hints better markdown styling you can take. Click the lightbulb on the editor status bar 💡
      Got it
      • Options
      • Versions and GitHub Sync
      • Transfer ownership
      • Delete this note
      • Template
      • Save as template
      • Insert from template
      • Export
      • Dropbox
      • Google Drive
      • Gist
      • Import
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
      • Download
      • Markdown
      • HTML
      • Raw HTML
      • ODF (Beta)
      • Sharing Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • More (Comment, Invitee)
      • Publishing
        Everyone on the web can find and read all notes of this public team.
        After the note is published, everyone on the web can find and read this note.
        See all published notes on profile page.
      • Commenting Enable
        Disabled Forbidden Owners Signed-in users Everyone
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Invitee
      • No invitee
    Menu Sharing Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Versions and GitHub Sync Transfer ownership Delete this note
    Export
    Dropbox Google Drive Gist
    Import
    Dropbox Google Drive Gist Clipboard
    Download
    Markdown HTML Raw HTML ODF (Beta)
    Back
    Sharing
    Sharing Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Note Permission
    Read
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Write
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    More (Comment, Invitee)
    Publishing
    Everyone on the web can find and read all notes of this public team.
    After the note is published, everyone on the web can find and read this note.
    See all published notes on profile page.
    More (Comment, Invitee)
    Commenting Enable
    Disabled Forbidden Owners Signed-in users Everyone
    Permission
    Owners
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Invitee
    No invitee
       owned this note    owned this note      
    Published Linked with GitHub
    Like BookmarkBookmarked
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Eth 2.0 DoS Workshop 29/10/2018 - Ethereum 2.0 workshop in Prague. Attendees: - Paul Hauner - Nishant - Jacek - Mikerah - Medhi - Mike - Mamy ## Objectives 1. Create a list of potential DoS vectors. 2. Explore mitigations for identified vectors. 3. Recommendations ## DoS Overview Denial of Service attacks prevent a service from performing it's duty. Typically they involve the consumation of all available resources so that a service can no longer function. In the context of Ethereum 2.0, some things to consider may involve: * Mechanisms that causes nodes of the P2P network from functioning. * A flaw in implementation could cause a node crashes on a block, or suffer a memory leak. ([e.g.](https://blog.ethereum.org/2016/09/18/security-alert-geth-nodes-crash-due-memory-bug/)) * If attacking a small subset of nodes could prevent messages from being delivered in a timely manner. * An onerous requirement of the specification which is not considered. * Certain operations may require an unexpectedy large amount of resources. ([e.g.](https://blog.ethereum.org/2016/09/22/ethereum-network-currently-undergoing-dos-attack/)) * Promising that a large amount of data would be sent, then proceeding to "drip feed" the data, maintaining a large number of open sessions * A method to leverage traffic in the P2P network for amplification * A small amount of data can trigger a large amount of data. ([e.g.](https://en.wikipedia.org/wiki/Denial-of-service_attack#Amplification)) * Any kind of "broadcast" messages. ## Attack Vectors ### 01: Storing Early Blocks An attacker could create many blocks that from "the future" which a client would need to store, potentially filling up RAM/disk. #### Mitigations 1. Ensure that there is some safe maximum to the amount of blocks that are queued awaiting a future slot. ### 04: Czech Roulette (more formally known as the Non-Deterministic Shuffling Problem (NDSP)) taking the randomness seed from the head block of the chain, means that any short range fork that also triggers that state transition might have a different randomness seed. This would cause multiple valid shufflings for the next cycle which would make it not possible to reject blocks from validators that don’t fit your world view of the shuffling. This is bad because it opens up a serious dos vector. The further back you put the seed into the chain (say you get the seed from N cycles ago, rather than from the current cycle), then the higher likelihood that the seed is coming from a block you see as finalized and thus at least a deterministic seed. This doesn’t actually solve the problem though because of the variability of whether a validator set change happened at the state transition. Say block A comes in and triggers a state transition but does not include enough attestations/crosslinks to trigger a validator set change. Block B (a shortrange fork) comes in, also triggers the state transition, but includes enough attestations/crosslinks to trigger a validator set change. Even if A and B agree on what seed they should use if there is a reshuffling, A would cause the reshuffling while B would so you’d have mismatched expected proposers that’s a quick dump of the range of the problem. (Taken from Danny's answer in Gitter. Will need to clean up and make clearer later) ### 02: Invalid `AttestationRecord` Signatures in Blocks An attacker could create blocks which contain a majority _valid_ `AttestationRecord` signatures, however have a single _invalid_ signature which makes the entire block invalid. This would cause the client to waste CPU cycles in validation BLS signatures. #### Mitigations 1. Ensure the block proposer `AttestationRecord` (the 0'th) is validated before all other `AttestationRecords`. This reduces the space of attackers to only the designated block producer. 2. Do a "coin flip" to determine the order in which `AttestationRecords` are verified, with the exception of the 0'th record. This would mitigate for the scenario where an attacker always knows that the last record in the array will be the last to be verified. Processing records concurrently would also assist making it difficult to predict the last record to be processed. ### 03: Invalid "free" `AttestationRecords` An attacker could produce "free"`AttestationRecords` (ones that are not included in blocks) that have an invalid signature and waste client CPU cycles. #### Mitigations See 02. ### More to come.. -------------- ## Notes ### Specification Vectors _(can someone do the notes here?)_ ### Implementation Vectors ### Network Vectors ### Questions 1. How does libp2p rank peers? 2. In particular, how does it define a "bad" peer? 3. How does it deal with "bad" peers? 2. Does a malicious validator bring down other valiators if they send an invalid block (or any misbehavior)?

    Import from clipboard

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lost their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template is not available.
    All
    • All
    • Team
    No template found.

    Create a template

    Delete template

    Do you really want to delete this template?

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in via Google

    New to HackMD? Sign up

    Help

    Documents

    Tutorials
    YAML Metadata
    Slide Example
    Book Example

    Contacts

    Talk to us
    Report an issue
    Send us email

    Cheatsheet

    Example Syntax
    Header # Header
    • Unordered List
    - Unordered List
    1. Ordered List
    1. Ordered List
    • Todo List
    - [ ] Todo List
    Blockquote
    > Blockquote
    Bold font **Bold font**
    Italics font *Italics font*
    Strikethrough ~~Strikethrough~~
    19th 19^th^
    H2O H~2~O
    Inserted text ++Inserted text++
    Marked text ==Marked text==
    Link [link text](https:// "title")
    Image ![image alt](https:// "title")
    Code `Code`
    var i = 0;
    ```javascript
    var i = 0;
    ```
    :smile: :smile:
    Externals {%youtube youtube_id %}
    LaTeX $L^aT_eX$

    This is a alert area.

    :::info
    This is a alert area.
    :::

    Versions

    Versions and GitHub Sync

    Sign in to link this note to GitHub Learn more
    This note is not linked with GitHub Learn more
     
    Add badge Pull Push GitHub Link Settings

    Version named by    

    More Less
    • Edit
    • Delete

    Note content is identical to the latest version.
    Compare with
      Choose a version
      No search result
      Version not found

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub

        Please sign in to GitHub and install the HackMD app on your GitHub repo. Learn more

         Sign in to GitHub

        HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully