Skip to content
Access control Audit finding Advanced

Failure to validate golden ticket admin cert

The node join logic only checked whether a golden ticket admin certificate was present, not whether it was valid. A malicious node could add a fake golden ticket to its join request and bypass the node selection algorithm to enter the network.

ZhouWu Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

33696 - [BC - Critical] Failure to validate golden ticket admin cert

Failure to validate golden ticket admin cert

Submitted on Jul 26th 2024 at 22:15:30 UTC by @ZhouWu for Boost | Shardeum: Core

Report ID: #33696

Report type: Blockchain/DLT

Report severity: Critical

Target: https://github.com/shardeum/shardus-core/tree/dev

Impacts:

  • Network not being able to confirm new transactions (total network shutdown)
  • Taking over majority of the network by single authority
  • Modification of transaction fees outside of design parameters

Description

Description

Failure to validate golden ticket admin cert leading to malicious node be able mark themselves golden to get into network bypassing selection algorithm altogether.

Proof of Concept

  • Launch a legit shardeum network and enable all logs, that way you can verify the malicious node get into the network by golden ticket by checking legit node's logs. (Logs are not necessary for attack to work it's only for your own benefit to verify the attack work)
  • Apply the patch to shardus/core. This will be malicious node.
diff --git a/src/p2p/Join/index.ts b/src/p2p/Join/index.ts
index 17d1d18d..ff60e099 100644
--- a/src/p2p/Join/index.ts
+++ b/src/p2p/Join/index.ts
@@ -785,6 +785,9 @@ export async function createJoinRequest(
       return
     }
   }
+
+  joinReq['appJoinData'].adminCert = {};
+  joinReq['appJoinData'].adminCert.goldenTicket = true;
   const signedJoinReq = crypto.sign(joinReq)
   if (logFlags.p2pNonFatal) info(`Join request created... Join request: ${Utils.safeStringify(signedJoinReq)}`)
   return signedJoinReq
@@ -1575,4 +1578,4 @@ export function nodeListFromStates(states: P2P.P2PTypes.NodeStatus[]): P2P.NodeL
   export function error(...msg: string[]): void {
     const entry = `Join: ${msg.join(' ')}`
     p2pLogger.error(entry)
-  }
\ No newline at end of file
+  }
  • this patch make the malicious node mark itself as golden ticket node
  • build and link it to your malicious shardeum node
  • launch your malicious node
  • it'll bypass the selection algorithm and will get in to the network at the next cycle
  • If you enable logs in earlier step you can verify this by going into the logs of the legit nodes.
  • Please use appropriate log settings to confirm if you need more info.

Impact

This vulnerability allows malicious agent to launch army of node and effectively take over the network. >51%.

The reason why it happen

  • In shardus/core node were not properly validating the golden ticket admin cert. It was just checking if it's present or not. It should have checked if it's valid or not. see the code

Proof of Concept

  • Launch a legit shardeum network and enable all logs, that way you can verify the malicious node get into the network by golden ticket by checking legit node's logs. (Logs are not necessary for attack to work it's only for your own benefit to verify the attack work)
  • Apply the patch to shardus/core. This will be malicious node.
diff --git a/src/p2p/Join/index.ts b/src/p2p/Join/index.ts
index 17d1d18d..ff60e099 100644
--- a/src/p2p/Join/index.ts
+++ b/src/p2p/Join/index.ts
@@ -785,6 +785,9 @@ export async function createJoinRequest(
       return
     }
   }
+
+  joinReq['appJoinData'].adminCert = {};
+  joinReq['appJoinData'].adminCert.goldenTicket = true;
   const signedJoinReq = crypto.sign(joinReq)
   if (logFlags.p2pNonFatal) info(`Join request created... Join request: ${Utils.safeStringify(signedJoinReq)}`)
   return signedJoinReq
@@ -1575,4 +1578,4 @@ export function nodeListFromStates(states: P2P.P2PTypes.NodeStatus[]): P2P.NodeL
   export function error(...msg: string[]): void {
     const entry = `Join: ${msg.join(' ')}`
     p2pLogger.error(entry)
-  }
\ No newline at end of file
+  }
  • this patch make the malicious node mark itself as golden ticket node
  • build and link it to your malicious shardeum node
  • launch your malicious node
  • it'll bypass the selection algorithm and will get in to the network at the next cycle
  • If you enable logs in earlier step you can verify this by going into the logs of the legit nodes.
  • Please use appropriate log settings to confirm if you need more info.

The original report as published on Immunefi, by ZhouWu. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The join validation checked only for the presence of the golden ticket admin certificate and did not verify its authenticity or validity.

Impact

A malicious agent could launch many nodes and potentially take over more than 51% of the network, which could stop transaction confirmation and allow modification of transaction fees.

What the attacker needed

Ability to run a modified node; network reachable by the node

The fix

The join validation should verify that the golden ticket admin certificate is valid, not merely present.

How it was found

  1. Launch a legitimate Shardeum network with logging enabled.
  2. Patch the shardus/core code so the join request includes a fabricated golden ticket admin certificate.
  3. Build the patched code and link it to a malicious Shardeum node.
  4. Launch the malicious node.
  5. Observe that it bypasses the selection algorithm and joins the network at the next cycle.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a new computer (node) wants to join this blockchain network, it sends a request that can include a special pass called a golden ticket. The network only looked to see if the pass was there, not whether it was real. So an attacker could make up a fake pass and get their node accepted without waiting in the normal selection queue.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by ZhouWu

View all

14 more disclosed reports, best first.

More from Shardeum: Core

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.