VDB
Sign up
HIGH

GHSA-4f99-4q7p-p3gh

Logrus is vulnerable to DoS when using Entry.Writer()

Quick fix

GHSA-4f99-4q7p-p3gh — github.com/sirupsen/logrus: upgrade to the fixed version with the command below.

go get github.com/sirupsen/logrus@v1.8.3

Details

A denial-of-service vulnerability exists in github.com/sirupsen/logrus when using Entry.Writer() to log a single-line payload larger than 64KB without newline characters. Due to limitations in the internal bufio.Scanner, the read fails with "token too long" and the writer pipe is closed, leaving Writer() unusable and causing application unavailability (DoS). This affects versions < 1.8.3, 1.9.0, and 1.9.2. The issue is fixed in 1.8.3, 1.9.1, and 1.9.3+, where the input is chunked and the writer continues to function even if an error is logged.

Are you affected?

Enter the version of the package you're using.

Affected packages

Go/github.com/sirupsen/logrus
Introduced in: 0Fixed in: 1.8.3
Fixgo get github.com/sirupsen/logrus@v1.8.3
Go/github.com/sirupsen/logrus
Introduced in: 1.9.0Fixed in: 1.9.1
Fixgo get github.com/sirupsen/logrus@v1.9.1
Go/github.com/sirupsen/logrus
Introduced in: 1.9.2Fixed in: 1.9.3
Fixgo get github.com/sirupsen/logrus@v1.9.3

References