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

x/vulndb: potential Go vuln in github.com/disintegration/imaging #1929

Closed
pic4xiu opened this issue Jul 15, 2023 · 0 comments
Closed

x/vulndb: potential Go vuln in github.com/disintegration/imaging #1929

pic4xiu opened this issue Jul 15, 2023 · 0 comments

Comments

@pic4xiu
Copy link

pic4xiu commented Jul 15, 2023

Description

When we use the imaging library to parse a maliciously constructed graph, the scan function of the scanner.go file will have an index out of bounds problem. The verification procedure is as follows:

package main

import (
 "image"
 "os"
 "runtime"

 "github.com/disintegration/imaging"
)

func main() {
 runtime.GOMAXPROCS(1)
 file, _ := os.Open("poc.tiff")
 src, _, err := image.Decode(file)
 if err != nil {
  return
 }
 imaging.Grayscale(src)
}

the poc.tiff is here:https://github.com/pic4xiu/pocRep/blob/main/poc.tiff

what happened

❯ go run poc.go
panic: runtime error: index out of range [70] with length 65

goroutine 3 [running]:
github.com/disintegration/imaging.(*scanner).scan(0x1400002a040, 0x0, 0x0, 0x96, 0x1, {0x140000f0000, 0x0?, 0xf168})
        /Users/**/go/pkg/mod/github.com/disintegration/[email protected]/scanner.go:242 +0x3a4
github.com/disintegration/imaging.Grayscale.func1(0x0?)
        /Users/**/go/pkg/mod/github.com/disintegration/[email protected]/adjust.go:16 +0xa0
github.com/disintegration/imaging.parallel.func1()
        /Users/**/go/pkg/mod/github.com/disintegration/[email protected]/utils.go:33 +0x5c
created by github.com/disintegration/imaging.parallel
        /Users/**/go/pkg/mod/github.com/disintegration/[email protected]/utils.go:31 +0xcc
exit status 2

Affected Modules, Packages, Versions and Symbols

Module: github.com/disintegration/imaging
Versions:
  - Introduced: 1.6.2
Symbols:
  - scan

CVE/GHSA ID

No response

Fix Commit or Pull Request

No response

References

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant