uberswe / beubo

Beubo is a free, simple, and minimal CMS with unlimited extensibility using plugins
MIT License
21 stars 4 forks source link

Incorrect conversion between integer types #41

Closed uberswe closed 3 years ago

uberswe commented 3 years ago

Found via CodeQL

Converting the result of strconv.Atoi, strconv.ParseInt, and strconv.ParseUint to integer types of smaller bit size can produce unexpected values.

Incorrect conversion of a 64-bit integer from strconv.ParseInt to a lower bit size type int without an upper bound check.

https://github.com/uberswe/beubo/blob/7870404f704a1b89d69f68485a2e695589d637eb/pkg/routes/page.go#L159-L159 https://github.com/uberswe/beubo/blob/7870404f704a1b89d69f68485a2e695589d637eb/pkg/routes/page.go#L101-L101 https://github.com/uberswe/beubo/blob/7870404f704a1b89d69f68485a2e695589d637eb/pkg/routes/page.go#L93-L93 https://github.com/uberswe/beubo/blob/7870404f704a1b89d69f68485a2e695589d637eb/pkg/routes/page.go#L39-L39