Skip to content
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

fix: validate dht header before dedup cache #3468

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Oct 18, 2021

Description

  • reorders the DHT messaging layers to validate the message before entering the dedup store.
  • adds the origin_mac to the dedup hash

This PR was written by @Impala123, I finished off a rust integration test

Motivation and Context

From original PR: #3450

With the current order of layers, a malicious node could tamper with a message which would then be discarded by the
validation layer. However the dedup cache currently stores this before it is discarded by validate. Thus any un-tampered
version of the same message would no longer be processed.

A valid origin mac means the message comes from the possessor of the private key and has not been altered.
The valid origin mac bytes are included in the dedup hash preimage so that the origin of the message (if any) is tied to
the dedup entry. Previously, an attacker could craft a message A' that had no/different valid origin MAC but the same body and cause a subsequent message A to not to be discarded as a duplicate.

How Has This Been Tested?

Rust integration test
memorynet

@aviator-app aviator-app bot merged commit 81f01d2 into tari-project:development Oct 18, 2021
@sdbondi sdbondi deleted the dht-validate-before-dedup branch October 19, 2021 07:18
sdbondi added a commit to sdbondi/tari that referenced this pull request Oct 25, 2021
* development: (31 commits)
  feat!: revalidate all outputs (tari-project#3471)
  fix: check SAF message inflight and check stored_at is in past (tari-project#3444)
  feat!: apps should not depend on other app configs (tari-project#3469)
  fix: fix recovery test reporting message (tari-project#3479)
  chore: improve cucumber tests to wait for broadcast (tari-project#3461)
  test: use TCP node for daily sync test (tari-project#3464)
  fix: remove unbounded vec allocations from base node grpc/p2p messaging (tari-project#3467)
  fix: upgrade rustyline dependencies (tari-project#3476)
  fix(dht): discard encrypted message with no destination (tari-project#3472)
  fix: remove consensus breaking change in transaction input (tari-project#3474)
  feat: tx weight takes tariscript and output features into account [igor] (tari-project#3411)
  fix: validate dht header before dedup cache (tari-project#3468)
  fix: sha256sum isn't available on all *nix platforms (tari-project#3466)
  fix: typo in console wallet (tari-project#3465)
  fix: ensure that accumulated orphan chain data is committed before header validation (tari-project#3462)
  fix: remove is_synced check for transaction validation (tari-project#3459)
  feat: improve logging for tari_mining_node (tari-project#3449)
  fix: remove unnecessary wallet dependency (tari-project#3438)
  test: simplify cucumber tests (tari-project#3457)
  ci: create script to update DNS records from hashes.txt (tari-project#3458)
  ...
@sdbondi sdbondi restored the dht-validate-before-dedup branch February 3, 2022 05:34
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.

3 participants