Exploit database

GH-f0a9bb99064fc5c640a8aca726a5dee3

actions-marketplace-validations/securego_gosec

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2022-23772

3 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files35

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

rules/implicit_aliasing_test.go

Go · 700 bytes
package rules

import (
	. "github.com/onsi/ginkgo/v2"
	. "github.com/onsi/gomega"

	"github.com/securego/gosec/v2"
)

var _ = Describe("NewImplicitAliasing", func() {
	It("should create rule for detecting implicit memory aliasing", func() {
		config := gosec.NewConfig()
		rule, nodes := NewImplicitAliasing("G601", config)

		Expect(rule).ShouldNot(BeNil())
		Expect(nodes).ShouldNot(BeEmpty())
		Expect(rule.ID()).Should(Equal("G601"))
		Expect(nodes).Should(HaveLen(3)) // RangeStmt, UnaryExpr, ReturnStmt
	})

	It("should initialize with correct metadata", func() {
		config := gosec.NewConfig()
		rule, _ := NewImplicitAliasing("G601", config)

		Expect(rule.ID()).Should(Equal("G601"))
	})
})