Skip to content

Conversation

lucash-dev
Copy link
Contributor

This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
Added comments to explicitly mention CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
This improves developer experience by making understanding the tests easier.

@fanquake fanquake added the Tests label Nov 9, 2018
@ken2812221
Copy link
Contributor

Concept ACK.

@practicalswift
Copy link
Contributor

practicalswift commented Nov 9, 2018

Concept ACK

Good idea!

@lucash-dev Would you be able to match other CVE:s against tests and include them in this PR? That would be really useful to have. It would be nice to be able to do git grep CVE-N on all issued Bitcoin Core CVE:s to be able to find the corresponding test case and/or fix

Perhaps Bitcoin CVE guru @luke-jr can help in this matching? :-)

@lucash-dev
Copy link
Contributor Author

I’ll do that. Sounds like a good learning opportunity too.

@maflcko maflcko added the Docs label Nov 9, 2018
@maflcko maflcko changed the title trivial: Add explicit references to related CVE's in p2p_invalid_block test. doc: Add explicit references to related CVE's in p2p_invalid_block test. Nov 9, 2018
# Manufacture a block with 3 transactions (coinbase, spend of prior
# coinbase, spend of that spend). Duplicate the 3rd transaction to
# leave merkle root and blockheader unchanged but invalidate the block.
# For more information on merkle-root malleability see src/consesus/merkle.cpp.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be "consensus" :-)

@maflcko maflcko changed the title doc: Add explicit references to related CVE's in p2p_invalid_block test. qa: Add explicit references to related CVE's in p2p_invalid_block test. Nov 10, 2018
@Empact
Copy link
Contributor

Empact commented Nov 13, 2018

Concept ACK

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 13, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15045 ([test] Apply maximal flags to tx_valid tests and minimal flags to tx_invalid tests by jl2012)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko
Copy link
Member

maflcko commented Nov 22, 2018

Needs rebase (silent conflict)

@laanwj
Copy link
Member

laanwj commented Nov 23, 2018

Thanks for adding these tests!
Concept ACK

@lucash-dev
Copy link
Contributor Author

lucash-dev commented Dec 3, 2018

Coudn't find much info on CVE-2012-4682, CVE-2012-4683. @luke-jr could you provide any pointers?

@lucash-dev
Copy link
Contributor Author

Rebased. Also refactored to use the new invalid tx template.

@fanquake
Copy link
Member

fanquake commented Jan 7, 2019

@lucash-dev Could you cleanup the trailing whitespace. That's what's causing Travis to fail:

./test/functional/data/invalid_txs.py:204:1: W293 blank line contains whitespace
./test/functional/data/invalid_txs.py:205:1: W293 blank line contains whitespace
./test/functional/data/invalid_txs.py:210:10: E131 continuation line unaligned for hanging indent

@laanwj
Copy link
Member

laanwj commented Jan 31, 2019

utACK a342ecd
Could squash some commits and fix spelling in commit messages

@lucash-dev
Copy link
Contributor Author

utACK a342ecd
Could squash some commits and fix spelling in commit messages

Sorry, should've prefixed the PR with "WIP" while I was working adding more comments for more CVEs. It's been a while since I've had time to work on this PR, though. It has also already grown far beyond the original intention (just a couple comments). So probably better if I just fix the commit history, and open a new PR later on when I manage to add comments/tests for the remaining CVEs.
Thanks for reviewing!

@lucash-dev
Copy link
Contributor Author

Fixed the commit history.

tx.calc_sha256()
return tx


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop one of the newlines here :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️

@practicalswift
Copy link
Contributor

utACK 203c328 modulo nit and squash

@lucash-dev
Copy link
Contributor Author

lucash-dev commented Feb 2, 2019

utACK 203c328 modulo nit and squash

Fixed nit. Further squashed to 2 commits. one for adding comments, other for new tests. Let me know if you'd like just one commit. just thought it would make sense to separate these two, but it's all the same to me.
And thanks for reviewing!

This commit adds comments referencing multiple CVEs both in production and test code.
CVEs covered in this commit:

CVE-2010-5137
CVE-2010-5139
CVE-2010-5141
CVE-2012-1909
CVE-2012-2459
CVE-2012-3789
CVE-2018-17144
…0-5137.

CVE-2018-17144 and CVE-2012-2459 are only partially tested for regression.
- CVE-2018-17144 is not tested for the inflation bug.
- CVE-2012-2459 is only tested for the mutated block being rejected, not
for the original block being accepted afterwards.

This commit fixes that limitation.

Also added functional test for CVE-2010-5137.
@lucash-dev
Copy link
Contributor Author

Rebased.

@Empact
Copy link
Contributor

Empact commented Jun 5, 2019

utACK 38bfca6

@laanwj
Copy link
Member

laanwj commented Sep 18, 2019

ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

@laanwj laanwj changed the title qa: Add explicit references to related CVE's in p2p_invalid_block test. qa: Add explicit references to related CVE's in p2p_invalid_block test Sep 18, 2019
laanwj added a commit that referenced this pull request Sep 18, 2019
…alid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
@laanwj laanwj merged commit 0c62e3a into bitcoin:master Sep 18, 2019
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 23, 2019
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 24, 2020
…s and production code.

Summary:
> This commit adds comments referencing multiple CVEs both in production and test code.
> CVEs covered in this commit:
>
> CVE-2010-5137
> CVE-2010-5139
> CVE-2010-5141
> CVE-2012-1909
> CVE-2012-2459
> CVE-2012-3789
> CVE-2018-17144

Backport of Core [[bitcoin/bitcoin#14696 | PR14696]] - part 1 of 2
Commit bitcoin/bitcoin@38bfca6

Test Plan:
`ninja && ninja check`
(just to make sure the src/test/data/script_tests.json change didn't break anything)

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8018
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 24, 2020
…012-2459, and CVE-2010-5137.

Summary:
CVE-2018-17144 and CVE-2012-2459 are only partially tested for regression.
- CVE-2018-17144 is not tested for the inflation bug.
- CVE-2012-2459 is only tested for the mutated block being rejected, not
for the original block being accepted afterwards.

This commit fixes that limitation.

Also added functional test for CVE-2010-5137.

This concludes backport of [[bitcoin/bitcoin#14696 | PR14696]] - part 2 of 2
Depends on D8018

Test Plan: `ninja && test/functional/test_runner.py p2p_invalid_block.py p2p_invalid_tx.py`

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox, deadalnix

Subscribers: deadalnix, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D8026
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request May 4, 2021
…tx functional tests coverage.

2d994c4 qa: adding test case for output value > input value out of range (furszy)
6165c80 qa: update and enable p2p_invalid_tx.py functional test. (furszy)
bb62699 Backport chainparams and validation `fRequireStandard` flags functionality + init 'acceptnonstdtxn' option to skip (most) "non-standard transaction" checks, for testnet/regtest only. (furszy)
0280c39 New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
ec7d0b0 [qa] Test for duplicate inputs within a transaction (Suhas Daftuar)
a501fe1 qa: update and enable p2p_invalid_block.py. (furszy)
f83d140 qa: Read reject reasons from debug log, not p2p messages (furszy)
8a50165 [tests] Add P2PDataStore class (furszy)
ebed910 qa: Correct coinbase input script height. (furszy)
cae2d43 [tests] Reduce NodeConn connection logging from info to debug (John Newbery)

Pull request description:

  Introduced the `P2PDataStore` class into the functional test suite and updated it up to a point where was able to enable the `p2p_invalid_block.py` and `p2p_invalid_tx.py` functional tests. Plus updated both tests to a much recent version, expanding its testing coverage as well.
  Now the test suite is covering the primary CVE that btc had in the past.

  As both tests were simply unusable before and we have a different synchronization process than upstream, plus we didn't have some params and init/global flags, this work isn't following a PR by PR back port path. Had to made my own way up to the complete tests support.

  Main pilar PRs from upstream from where this work was based:
  * dashpay#6329.
  * bitcoin#11771.
  * bitcoin#14119 (only `p2p_invalid_tx.py`, `p2p_invalid_block.py` and `mininode.py` changes).
  * bitcoin#14247 (only 9b4a36e).
  * bitcoin#14696.

ACKs for top commit:
  random-zebra:
    ACK 2d994c4

Tree-SHA512: 548830b5fbf8b7f383832a7eea96179d089a4c9c222ef34007846f53736b07c873e37084235f1575eac157b63308c00ab3be78b71d3ed6520f4f73f1c8de81a5
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Dec 6, 2021
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Dec 7, 2021
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Dec 10, 2021
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Dec 13, 2021
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Dec 13, 2021
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Dec 15, 2021
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Dec 15, 2021
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Dec 15, 2021
…p2p_invalid_block test.

0c62e3a New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
38bfca6 Added comments referencing multiple CVEs in tests and production code. (lucash-dev)

Pull request description:

  This functional test includes two scenarios that test for regressions of vulnerabilities, but they are only briefly described. There are freely available documents explaining in detail the issues, but without explicit mentions, the developer trying to maintain the code needs an additional step of digging in commit history and PR conversations to figure it out.
  Added comments to explicitly mention  CVE-2018-17144 and CVE-2012-2459, for more complete documentation.
  This improves developer experience by making understanding the tests easier.

ACKs for top commit:
  laanwj:
    ACK 0c62e3a, checked the CVE numbers, thanks for adding documentation

Tree-SHA512: 3ee05351745193b8b959e4a25d50f25a693b2d24b0732ed53cf7d5882df40b5dd0f1877bd5c69cffb921d4a7acf9deb3cc1160b96dc730d9b5984151ad06b7c9
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants