libbsd: Arbitrary code execution — GLSA 201607-13

A buffer overflow in libbsd might allow remote attackers to execute arbitrary code.

Affected Packages

dev-libs/libbsd on all architectures
Affected versions < 0.8.2
Unaffected versions >= 0.8.2

Background

This library provides useful functions commonly found on BSD systems, and lacking on others like GNU systems, thus making it easier to port projects with strong BSD origins, without needing to embed the same code over and over again on each project.

Description

libbsd contains a buffer overflow in the fgetwln() function. An if statement, which is responsible for checking the necessity to reallocate memory in the target buffer, is off by one therefore an out of bounds write occurs.

Impact

Remote attackers could potentially execute arbitrary code with the privileges of the process.

Workaround

There is no known workaround at this time.

Resolution

All libbsd users should upgrade to the latest version:

 # emerge --sync
 # emerge --ask --verbose --oneshot ">=dev-libs/libbsd-0.8.2"
 

References

Release Date
July 20, 2016

Latest Revision
July 20, 2016: 1

Severity
normal

Exploitable
remote

Bugzilla entries