Bug 1542149 - Add some MacOS file extensions to to the list of executable extensions in download protection. r=Gijs
authorDimi Lee <dlee@mozilla.com>
Fri, 05 Apr 2019 12:04:49 +0000
changeset 468409 d2b7450ab5c61b9e934b7d8bd32b46f3cd1547b6
parent 468408 0fbc141c10046b151442b8164b4366757d6409bd
child 468410 f6bf51e87b1aafe0b76a0dfd82546c99983dd3f4
push id35837
push userrmaries@mozilla.com
push dateTue, 09 Apr 2019 03:43:40 +0000
treeherdermozilla-central@9eb55c9bf557 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1542149
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1542149 - Add some MacOS file extensions to to the list of executable extensions in download protection. r=Gijs Here are the file extensions are added to the list: 1. action 2. caction 3. configprofile 4. definition 5. dylib 6. internetconnect 7. networkconnect 8. service 9. wflow 10.workflow Differential Revision: https://phabricator.services.mozilla.com/D26284
toolkit/components/reputationservice/ApplicationReputation.cpp
toolkit/components/reputationservice/ApplicationReputation.h
toolkit/components/reputationservice/test/gtest/TestExecutableLists.cpp
--- a/toolkit/components/reputationservice/ApplicationReputation.cpp
+++ b/toolkit/components/reputationservice/ApplicationReputation.cpp
@@ -157,17 +157,17 @@ const char* const ApplicationReputationS
 /* static */
 const char* const ApplicationReputationService::kBinaryFileExtensions[] = {
     // Originally extracted from the "File Type Policies" Chrome extension
     // Items listed with an `exec` comment are in the sExecutableExts list in
     // nsLocalFileCommon.h .
     //".001",
     //".7z",
     //".ace",
-    //".action", // Mac script
+    ".action",  // Mac script
     //".ad", exec // Windows
     //".ade", exec  // MS Access
     //".adp", exec // MS Access
     //".air", exec // Adobe AIR installer; excluded from apprep checks.
     ".apk",  // Android package
     //".app", exec  // Executable application
     ".applescript",
     //".application", exec // MS ClickOnce
@@ -188,36 +188,39 @@ const char* const ApplicationReputationS
     ".btinstall",  // uTorrent and Transmission
     ".btkey",      // uTorrent and Transmission
     ".btsearch",   // uTorrent and Transmission
     ".btskin",     // uTorrent and Transmission
     ".bz",         // Linux archive (bzip)
     ".bz2",        // Linux archive (bzip2)
     ".bzip2",      // Linux archive (bzip2)
     ".cab",        // Windows archive
+    ".caction",    // Automator action
     ".cdr",        // Mac disk image
     ".cfg",        // Windows
     ".chi",        // Windows Help
     //".chm", exec // Windows Help
     ".class",  // Java
     //".cmd", exec // Windows executable
     //".com", exec // Windows executable
-    ".command",  // Mac script
-    ".cpgz",     // Mac archive
-    ".cpi",      // Control Panel Item. Executable used for adding icons
-                 // to Control Panel
+    ".command",        // Mac script
+    ".configprofile",  // Configuration file for Apple systems
+    ".cpgz",           // Mac archive
+    ".cpi",            // Control Panel Item. Executable used for adding icons
+                       // to Control Panel
     //".cpio",
     //".cpl", exec  // Windows executable
     //".crt", exec  // Windows signed certificate
     ".crx",  // Chrome extensions
     ".csh",  // Linux shell
     //".csv",
     ".dart",        // Mac disk image
     ".dc42",        // Apple DiskCopy Image
     ".deb",         // Linux package
+    ".definition",  // Automator action
     ".desktop",     // A shortcut that runs other files
     ".dex",         // Android
     ".dht",         // HTML
     ".dhtm",        // HTML
     ".dhtml",       // HTML
     ".diskcopy42",  // Apple DiskCopy Image
     ".dll",         // Windows executable
     ".dmg",         // Mac disk image
@@ -227,16 +230,17 @@ const char* const ApplicationReputationS
     ".docm",        // MS Word
     ".docx",        // MS Word
     ".dot",         // MS Word
     ".dotm",        // MS Word
     ".dott",        // MS Office
     ".dotx",        // MS Word
     ".drv",         // Windows driver
     ".dvdr",        // Mac Disk image
+    ".dylib",       // Mach object dynamic library file
     ".efi",         // Firmware
     ".eml",         // MS Outlook
     //".exe", exec // Windows executable
     //".fat",
     ".fon",  // Windows font
     //".fxp", exec // MS FoxPro
     ".gadget",  // Windows
     //".gif",
@@ -250,16 +254,17 @@ const char* const ApplicationReputationS
     ".htm", ".html",
     ".htt",  // MS HTML template
     //".ica",
     ".img",      // Mac disk image
     ".imgpart",  // Mac disk image
     //".inf", exec // Windows installer
     ".ini",  // Generic config file
     //".ins", exec // IIS config
+    ".internetconnect",  // Configuration file for Apple system
     //".inx", // InstallShield
     ".iso",  // CD image
     //".isp", exec // IIS config
     //".isu", // InstallShield
     //".jar", exec // Java
     //".jnlp", exec // Java
     //".job", // Windows
     //".jpg",
@@ -310,17 +315,18 @@ const char* const ApplicationReputationS
     //".msh1", exec // Windows shell
     //".msh1xml", exec  // Windows shell
     //".msh2", exec // Windows shell
     //".msh2xml", exec // Windows shell
     //".mshxml", exec // Windows
     //".msi", exec  // Windows installer
     //".msp", exec  // Windows installer
     //".mst", exec  // Windows installer
-    ".ndif",  // Mac disk image
+    ".ndif",            // Mac disk image
+    ".networkconnect",  // Configuration file for Apple systems
     //".ntfs", // 7z
     ".ocx",  // ActiveX
     //".ops", exec  // MS Office
     ".osas",  // AppleScript
     ".osax",  // AppleScript
     //".out", // Linux binary
     ".oxt",  // OpenOffice extension, can execute arbitrary code
     //".package",
@@ -406,16 +412,17 @@ const char* const ApplicationReputationS
     //".run", // Linux shell
     //".scf", exec         // Windows shell
     ".scpt",   // AppleScript
     ".scptd",  // AppleScript
     //".scr", exec         // Windows
     //".sct", exec         // Windows shell
     ".search-ms",  // Windows
     ".seplugin",   // AppleScript
+    ".service",    // Systemd service unit file
     //".settingcontent-ms", exec // Windows settings
     ".sh",    // Linux shell
     ".shar",  // Linux shell
     //".shb", exec         // Windows
     //".shs", exec         // Windows shell
     ".sht",           // HTML
     ".shtm",          // HTML
     ".shtml",         // HTML
@@ -469,19 +476,20 @@ const char* const ApplicationReputationS
     //".vst",  exec  // MS Visio
     //".vstm", exec  // MS Visio
     //".vstx", exec  // MS Visio
     //".vsw",  exec  // MS Visio
     //".vsx",  exec  // MS Visio
     //".vtx",  exec  // MS Visio
     //".wav",
     //".webp",
-    ".website",  // Windows
-    ".wim",      // Windows Imaging
-    //".workflow", // Mac Automator
+    ".website",   // Windows
+    ".wflow",     // Automator action
+    ".wim",       // Windows Imaging
+    ".workflow",  // Mac Automator
     //".wrc", // FreeArc archive
     //".ws",  exec  // Windows script
     //".wsc", exec  // Windows script
     //".wsf", exec  // Windows script
     //".wsh", exec  // Windows script
     ".xar",   // MS Excel
     ".xbap",  // XAML Browser Application
     ".xht", ".xhtm", ".xhtml",
--- a/toolkit/components/reputationservice/ApplicationReputation.h
+++ b/toolkit/components/reputationservice/ApplicationReputation.h
@@ -24,19 +24,19 @@ class ApplicationReputationService final
     : public nsIApplicationReputationService {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIAPPLICATIONREPUTATIONSERVICE
 
  public:
   static const char* const kNonBinaryExecutables[2];
 #ifdef XP_WIN
-  static const char* const kBinaryFileExtensions[176];
+  static const char* const kBinaryFileExtensions[186];
 #else
-  static const char* const kBinaryFileExtensions[175];
+  static const char* const kBinaryFileExtensions[185];
 #endif
   static already_AddRefed<ApplicationReputationService> GetSingleton();
 
  private:
   friend class PendingLookup;
   friend class PendingDBLookup;
   /**
    * Global singleton object for holding this factory service.
--- a/toolkit/components/reputationservice/test/gtest/TestExecutableLists.cpp
+++ b/toolkit/components/reputationservice/test/gtest/TestExecutableLists.cpp
@@ -4,98 +4,104 @@
 #include "gtest/gtest.h"
 #include "mozilla/ArrayUtils.h"
 #include "nsLocalFileCommon.h"
 #include "ApplicationReputation.h"
 
 // PLEASE read the comment in ApplicationReputation.cpp before modifying this
 // list.
 static const char* const kTestFileExtensions[] = {
-    ".ad",   // Windows (ignored for app rep)
-    ".ade",  // MS Access
-    ".adp",  // MS Access
-    ".air",  // Adobe Air (ignored for app rep)
-    ".apk",  // Android package
-    ".app",  // Executable application
+    ".action",  // Nac script
+    ".ad",      // Windows (ignored for app rep)
+    ".ade",     // MS Access
+    ".adp",     // MS Access
+    ".air",     // Adobe Air (ignored for app rep)
+    ".apk",     // Android package
+    ".app",     // Executable application
     ".applescript",
     ".application",  // MS ClickOnce
     ".appref-ms",    // MS ClickOnce
     ".as",           // Mac archive
     ".asp",          // Windows Server script
     ".asx",          // Windows Media Player
     ".bas",          // Basic script
     ".bash",         // Linux shell
     ".bat",          // Windows shell
     ".bin",
-    ".btapp",       // uTorrent and Transmission
-    ".btinstall",   // uTorrent and Transmission
-    ".btkey",       // uTorrent and Transmission
-    ".btsearch",    // uTorrent and Transmission
-    ".btskin",      // uTorrent and Transmission
-    ".bz",          // Linux archive (bzip)
-    ".bz2",         // Linux archive (bzip2)
-    ".bzip2",       // Linux archive (bzip2)
-    ".cab",         // Windows archive
-    ".cdr",         // Mac disk image
-    ".cfg",         // Windows
-    ".chi",         // Windows Help
-    ".chm",         // Windows Help
-    ".class",       // Java
-    ".cmd",         // Windows executable
-    ".com",         // Windows executable
-    ".command",     // Mac script
-    ".cpgz",        // Mac archive
-    ".cpi",         // Control Panel Item. Executable used for adding icons
-                    // to Control Panel
-    ".cpl",         // Windows executable
-    ".crt",         // Windows signed certificate
-    ".crx",         // Chrome extensions
-    ".csh",         // Linux shell
-    ".dart",        // Mac disk image
-    ".dc42",        // Apple DiskCopy Image
-    ".deb",         // Linux package
-    ".desktop",     // A shortcut that runs other files
-    ".dex",         // Android
-    ".dht",         // HTML
-    ".dhtm",        // HTML
-    ".dhtml",       // HTML
-    ".diskcopy42",  // Apple DiskCopy Image
-    ".dll",         // Windows executable
-    ".dmg",         // Mac disk image
-    ".dmgpart",     // Mac disk image
-    ".doc",         // MS Office
-    ".docb",        // MS Office
-    ".docm",        // MS Word
-    ".docx",        // MS Word
-    ".dot",         // MS Word
-    ".dotm",        // MS Word
-    ".dott",        // MS Office
-    ".dotx",        // MS Word
-    ".drv",         // Windows driver
-    ".dvdr",        // Mac Disk image
-    ".efi",         // Firmware
-    ".eml",         // MS Outlook
-    ".exe",         // Windows executable
-    ".fon",         // Windows font
-    ".fxp",         // MS FoxPro
-    ".gadget",      // Windows
-    ".grp",         // Windows
-    ".gz",          // Linux archive (gzip)
-    ".gzip",        // Linux archive (gzip)
-    ".hfs",         // Mac disk image
-    ".hlp",         // Windows Help
-    ".hqx",         // Mac archive
-    ".hta",         // HTML trusted application
+    ".btapp",          // uTorrent and Transmission
+    ".btinstall",      // uTorrent and Transmission
+    ".btkey",          // uTorrent and Transmission
+    ".btsearch",       // uTorrent and Transmission
+    ".btskin",         // uTorrent and Transmission
+    ".bz",             // Linux archive (bzip)
+    ".bz2",            // Linux archive (bzip2)
+    ".bzip2",          // Linux archive (bzip2)
+    ".cab",            // Windows archive
+    ".caction",        // Automator action
+    ".cdr",            // Mac disk image
+    ".cfg",            // Windows
+    ".chi",            // Windows Help
+    ".chm",            // Windows Help
+    ".class",          // Java
+    ".cmd",            // Windows executable
+    ".com",            // Windows executable
+    ".command",        // Mac script
+    ".configprofile",  // Configuration file for Apple systems
+    ".cpgz",           // Mac archive
+    ".cpi",            // Control Panel Item. Executable used for adding icons
+                       // to Control Panel
+    ".cpl",            // Windows executable
+    ".crt",            // Windows signed certificate
+    ".crx",            // Chrome extensions
+    ".csh",            // Linux shell
+    ".dart",           // Mac disk image
+    ".dc42",           // Apple DiskCopy Image
+    ".deb",            // Linux package
+    ".definition",     // Automator action
+    ".desktop",        // A shortcut that runs other files
+    ".dex",            // Android
+    ".dht",            // HTML
+    ".dhtm",           // HTML
+    ".dhtml",          // HTML
+    ".diskcopy42",     // Apple DiskCopy Image
+    ".dll",            // Windows executable
+    ".dmg",            // Mac disk image
+    ".dmgpart",        // Mac disk image
+    ".doc",            // MS Office
+    ".docb",           // MS Office
+    ".docm",           // MS Word
+    ".docx",           // MS Word
+    ".dot",            // MS Word
+    ".dotm",           // MS Word
+    ".dott",           // MS Office
+    ".dotx",           // MS Word
+    ".drv",            // Windows driver
+    ".dvdr",           // Mac Disk image
+    ".dylib",          // Mach object dynamic library file
+    ".efi",            // Firmware
+    ".eml",            // MS Outlook
+    ".exe",            // Windows executable
+    ".fon",            // Windows font
+    ".fxp",            // MS FoxPro
+    ".gadget",         // Windows
+    ".grp",            // Windows
+    ".gz",             // Linux archive (gzip)
+    ".gzip",           // Linux archive (gzip)
+    ".hfs",            // Mac disk image
+    ".hlp",            // Windows Help
+    ".hqx",            // Mac archive
+    ".hta",            // HTML trusted application
     ".htm", ".html",
     ".htt",                // MS HTML template
     ".img",                // Mac disk image
     ".imgpart",            // Mac disk image
     ".inf",                // Windows installer
     ".ini",                // Generic config file
     ".ins",                // IIS config
+    ".internetconnect",    // Configuration file for Apple system
     ".iso",                // CD image
     ".isp",                // IIS config
     ".jar",                // Java
     ".jnlp",               // Java
     ".js",                 // JavaScript script
     ".jse",                // JScript
     ".ksh",                // Linux shell
     ".lnk",                // Windows
@@ -132,16 +138,17 @@ static const char* const kTestFileExtens
     ".msh1xml",            // Windows shell
     ".msh2",               // Windows shell
     ".msh2xml",            // Windows shell
     ".mshxml",             // Windows
     ".msi",                // Windows installer
     ".msp",                // Windows installer
     ".mst",                // Windows installer
     ".ndif",               // Mac disk image
+    ".networkconnect",     // Configuration file for Apple system
     ".ocx",                // ActiveX
     ".ops",                // MS Office
     ".osas",               // AppleScript
     ".osax",               // AppleScript
     ".oxt",                // OpenOffice extension, can execute arbitrary code
     ".partial",            // Downloads
     ".pax",                // Mac archive
     ".pcd",                // Microsoft Visual Test
@@ -183,16 +190,17 @@ static const char* const kTestFileExtens
     ".rtf",                // MS Office
     ".scf",                // Windows shell
     ".scpt",               // AppleScript
     ".scptd",              // AppleScript
     ".scr",                // Windows
     ".sct",                // Windows shell
     ".search-ms",          // Windows
     ".seplugin",           // AppleScript
+    ".service",            // Systemd service unit file
     ".settingcontent-ms",  // Windows settings
     ".sh",                 // Linux shell
     ".shar",               // Linux shell
     ".shb",                // Windows
     ".shs",                // Windows shell
     ".sht",                // HTML
     ".shtm",               // HTML
     ".shtml",              // HTML
@@ -237,17 +245,19 @@ static const char* const kTestFileExtens
     ".vssx",      // MS Visio
     ".vst",       // MS Visio
     ".vstm",      // MS Visio
     ".vstx",      // MS Visio
     ".vsw",       // MS Visio
     ".vsx",       // MS Visio
     ".vtx",       // MS Visio
     ".website",   // Windows
+    ".wflow",     // Automator action
     ".wim",       // Windows Imaging
+    ".workflow",  // Mac Automator
     ".ws",        // Windows script
     ".wsc",       // Windows script
     ".wsf",       // Windows script
     ".wsh",       // Windows script
     ".xar",       // MS Excel
     ".xbap",      // XAML Browser Application
     ".xht", ".xhtm", ".xhtml",
     ".xip",     // Mac archive