Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Fuzz testing #1295

Closed
mkg20001 opened this issue Apr 3, 2018 · 7 comments
Closed

Fuzz testing #1295

mkg20001 opened this issue Apr 3, 2018 · 7 comments
Assignees
Labels
exp/expert Having worked on the specific codebase is important kind/maybe-in-helia P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@mkg20001
Copy link
Contributor

mkg20001 commented Apr 3, 2018

  • Version: hopefully the next
  • Platform: *
  • Subsystem: *

Type: enhancment / question

Severity: medium

Description: Fuzz Testing

I have discovered many critical application crashes by accident after my node was crashed by the invalid data it recived.

Such kinds of crashes are likely unacceptable in production.
Discovering them by accident isn't really a solution to that. #1292 libp2p/js-libp2p#179

So I propose to add some tests that just bombard the node with random semi-valid or invalid data. Aka fuzz testing.

@daviddias
Copy link
Member

//cc @fsdiogo

@daviddias daviddias added the status/ready Ready to be worked label Jun 4, 2018
@fsdiogo
Copy link
Contributor

fsdiogo commented Jun 7, 2018

Where do you guys suggest I start? I'm a bit lost to be honest.

@daviddias
Copy link
Member

@fsdiogo are you familiar with the concept of fuzz testing -- https://en.wikipedia.org/wiki/Fuzzing --? It will be powerful for your goal of #1325.

@pgte and @satazor should/might have a lot of ideas to help you here :)

@fsdiogo
Copy link
Contributor

fsdiogo commented Jun 8, 2018

Yes I'm familiar with the concept, although have never implemented it.

My question was a bit more specific, should I start in js-ipfs, libp2p?

What do you mean when a node receives invalid data?

@lidel
Copy link
Member

lidel commented Aug 15, 2018

I will go on a limb here and say that the low hanging fruit in js-ipfs is CLI and HTTP API. It may be easier to reason about creating fuzzing tests for them plus user/developer experience will directly benefit from that.

Fuzzing around messaging between nodes should happen in libp2p project, I think.

@mkg20001
Copy link
Contributor Author

Fuzzing around messaging between nodes should happen in libp2p project, I think.

I have to disagree with that as for example #1292 clearly was an IPFS specific issue, although generic safeguards for not crashing the node should be implemented in libp2p. (for ex wrapping the libp2p protocol handler in a try/catch and printing to stderr instead of crashing)

@whizzzkid
Copy link

js-ipfs is being deprecated in favor of Helia. You can #4336 and read the migration guide.

Please feel to reopen with any comments before 2023-06-05. We will do a final pass on reopened issues afterward (see #4336).

There are no plans to implement this in Helia yet, please feel free to create an issue there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/maybe-in-helia P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants