Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • secdb secdb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • alpinealpine
  • infrainfra
  • dockerdocker
  • secdbsecdb
  • Issues
  • #2
Closed
Open
Issue created Jan 05, 2021 by Teppei Fukuda@knqyf263

Empty values also should be an array as usual

Hi all, thank you for providing security advisories.

I found some cases where an empty value has a different type than usual. For example,

$ wget https://secdb.alpinelinux.org/v3.3/community.json
$ jq . community.json
{
  "archs": [
    "x86_64",
    "x86",
    "armhf"
  ],
  "packages": {},
  "urlprefix": "http://dl-cdn.alpinelinux.org/alpine",
  "distroversion": "v3.3",
  "apkurl": "{{urlprefix}}/{{distroversion}}/{{reponame}}/{{arch}}/{{pkg.name}}-{{pkg.ver}}.apk",
  "reponame": "community"
}

As shown above, "packages" is an object, even though it is usually an array. It causes an unmarshal error in Go.

json: cannot unmarshal object into Go value of type []alpine.packages

The same issue exists in pkg as well.

   {
      "pkg": {
        "name": "heimdal",
        "secfixes": {
          "7.1.0-r1": [
            "CVE-2017-11103"
          ],
          "7.1.0-r2": [
            "CVE-2017-17439"
          ],
          "7.4.0-r0": {}
        }
      }
    },

It is possible to fix it?

Edited Jan 05, 2021 by Teppei Fukuda
Assignee
Assign to
Time tracking