Project

General

Profile

Actions

Bug #1109

closed

Security vulnerability in storescp's --exec-on-reception and --exec-on-eostudy options

Added by Marco Eichelberg over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
High
Category:
Application
Target version:
Start date:
2024-02-21
Due date:
% Done:

100%

Estimated time:
2:00 h
Module:
dcmnet
Operating System:
Compiler:

Description

When storescp is executed with the --exec-on-reception or --exec-on-eostudy option, a command line can be specified that will be executed after the receipt of an image, or the receipt of an entire study, respectively.
The command line can contain certain placeholders, such as #f for the filename of the DICOM file, #a for the calling aetitle, or #c for the called aetitle.
The code that copies the application entity titles into the command line is not protected against shell escape characters. This can be abused by a malicious attacker to pass a short command (less than 16 characters) in the aetitle that will be executed by storescp.
The issue can be demonstrated by running (in two different shells):

storescp --exec-on-reception "echo '#c'" 10004
storescu localhost 10004 testfile.dcm --call "';touch TEST'" 
This will cause a file named TEST" to be created in the directory where storescp is executed.

Note: This vulnerability is only present when storescp is executed with the --exec-on-reception or --exec-on-eostudy option, and the command line passed to this option contains the '#a' or '#c' placeholder.

Reported 2024-02-14 by Phileas Lebada <>.

Actions #1

Updated by Marco Eichelberg over 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
  • Estimated time set to 2:00 h

Closed by commit #b789e34e1.

Actions #2

Updated by Marco Eichelberg over 1 year ago

  • Private changed from No to Yes
Actions #3

Updated by Marco Eichelberg over 1 year ago

  • Private changed from Yes to No
Actions

Also available in: Atom PDF