CVE-2022-1893 (published 2022-05-31T22:15Z)

Improper Removal of Sensitive Information Before Storage or Transfer in GitHub repository polonel/trudesk prior to 1.2.3.

Severity: MEDIUM
CVSS v2 base score: 5.0 (AV:N/AC:L/Au:N/C:P/I:N/A:N)
CVSS v3 base score: 5.3, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N)

Weakness information:
cwe_id: CWE-212
cwe_name: Improper Removal of Sensitive Information Before Storage or Transfer
description: The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors.
extended_description: 
            Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
            For example, a product for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.
         
         

Fix information:
repo_url: https://github.com/polonel/trudesk
commit_details: repo_url: https://github.com/polonel/trudesk
author: Chris Brame
author_date: 2022-05-28 04:12:16-04:00
msg: fix(core): image data removal
repository: repo_url: https://github.com/polonel/trudesk
repo_name: polonel/trudesk
description:  :coffee: :seedling: Trudesk is an open-source help desk/ticketing solution.
repo_language: JavaScript
owner: polonel
file_changes: filename: main.js
change_type: ModificationType.MODIFY
diff: @@ -655,6 +655,9 @@ mainController.uploadFavicon = function (req, res) {
     }
 
     if (!fs.existsSync(object.filePath)) return res.status(400).send('File failed to save to disk')
+    if (path.extname(object.filename) === '.jpg' || path.extname(object.filename) === '.jpeg') {
+      require('../helpers/utils').stripExifData(object.filePath)
+    }
 
     settingUtil.setSetting('gen:customfavicon', true, function (err) {
       if (err) return res.status(400).send('Failed to save setting to database')
@@ -727,6 +730,9 @@ mainController.uploadLogo = function (req, res) {
     }
 
     if (!fs.existsSync(object.filePath)) return res.status(400).send('File failed to save to disk')
+    if (path.extname(object.filename) === '.jpg' || path.extname(object.filename) === '.jpeg') {
+      require('../helpers/utils').stripExifData(object.filePath)
+    }
 
     settingUtil.setSetting('gen:customlogo', true, function (err) {
       if (err) return res.status(400).send('Failed to save setting to database')
@@ -800,6 +806,9 @@ mainController.uploadPageLogo = function (req, res) {
     }
 
     if (!fs.existsSync(object.filePath)) return res.status(400).send('File failed to save to disk')
+    if (path.extname(object.filename) === '.jpg' || path.extname(object.filename) === '.jpeg') {
+      require('../helpers/utils').stripExifData(object.filePath)
+    }
 
     settingUtil.setSetting('gen:custompagelogo', true, function (err) {
       if (err) return res.status(400).send('Failed to save setting to database')

programming_language: CoffeeScript