Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

buger/jsonparser #5

Closed
dbemiller opened this issue Aug 2, 2018 · 7 comments
Closed

buger/jsonparser #5

dbemiller opened this issue Aug 2, 2018 · 7 comments
Labels
needs investigation we need to investigate some things about this project

Comments

@dbemiller
Copy link

  • Where is the project currently hosted?

https://github.com/buger/jsonparser

  • Is the project written only in Go, or does it contain other languages (beyond scripts)?

Go only

  • Has the project had any recent activity?

Last commit: March 18... but the activity has been sparse since July 2017.

  • Does the project have a maintainer, or a maintainer looking for someone to take
    over the project?

https://github.com/buger (I assume)

  • Do you have any example projects that make use of this package?

https://godoc.org/github.com/buger/jsonparser?importers

  • Are there any outstanding critical bugs that result in the library being
    totally unusable or insecure?

It depends on your use case... but these are critical if you use the library to parse untrusted JSON and rely on it to return errors:

@afiune
Copy link

afiune commented Aug 8, 2018

FYI: Issue buger/jsonparser#127 has been solved!

@theckman
Copy link
Member

@dbemiller Thankfully seems like the author is still around/merging some things, albeit not many of them. How were you thinking we should look to help with this project?

@theckman theckman added the needs investigation we need to investigate some things about this project label Aug 12, 2018
@hchagen
Copy link

hchagen commented Aug 13, 2018

Both buger/jsonparser#127 and buger/jsonparser#121 were fixed by my latest PR, merged to master 5 days ago :)

@dbemiller
Copy link
Author

dbemiller commented Aug 13, 2018

@theckman I think we can close this. At the time I opened this issue, buger/jsonparser#127 had been open for 9 months, and @hchagen's PR fixing it had been open for 1 month, without any comments from the owner.

I had made a fork for our own project with those fixes merged in, but reached out here in hopes of starting a more community-driven fork.

These have been fixed, though, and I don't know of any other critical bugs in the library... so I think we should be ok now.

@adamdecaf
Copy link
Member

I'm in favor of closing this as after a quick glance over the open issues nothing popped out to me as critical.

This project is being used by a fair number of projects, but since there's an active fork all we'd do is take control of that? Do we need to?

@adamdecaf
Copy link
Member

I ran into github.com/zimmski/fuzzer, which has a super simple fuzzing test. I adapted it and am running over this project. I'm going to run go-fuzz over this project too.

fuzz example
package json

import (
	"fmt"
	"math/rand"
	"os"
	"testing"
	"time"

	"github.com/buger/jsonparser"
	"github.com/zimmski/tavor/fuzz/strategy"
	"github.com/zimmski/tavor/parser"
)

func TestJson(t *testing.T) {
	file, err := os.Open("./../../json-rfc7159.minimal.tavor")
	if err != nil {
		panic(fmt.Sprintf("cannot open tavor file %s: %v", os.Args[1], err))
	}
	defer func() {
		if err := file.Close(); err != nil {
			panic(err)
		}
	}()

	doc, err := parser.ParseTavor(file)
	if err != nil {
		panic(fmt.Sprintf("cannot parse tavor file: %v", err))
	}

	r := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))
	ch, err := strategy.NewAlmostAllPermutations(doc, r)
	if err != nil {
		panic(err)
	}

	for i := range ch {
		bs := []byte(doc.String())

		jsonparser.Get(bs, "foo")
		jsonparser.GetInt(bs, "num")
		jsonparser.ArrayEach(bs, func(_ []byte, _ jsonparser.ValueType, _ int, _ error) {
			return
		}, "thing")

		ch <- i
	}
}

@theckman
Copy link
Member

👍 on closing this at this time. Nothing prevents us from opening a new issue in the future if we want to reconsider this project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs investigation we need to investigate some things about this project
Projects
None yet
Development

No branches or pull requests

5 participants