Home
%3CLINGO-SUB%20id%3D%22lingo-sub-723569%22%20slang%3D%22en-US%22%3EThe%20Case%20of%20the%20Insecure%20Security%20Software%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-723569%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TechNet%20on%20Jun%2015%2C%202007%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20A%20little%20over%20a%20year%20ago%20I%20set%20out%20to%20determine%20exactly%20why%2C%20prior%20to%20Window%20Vista%2C%20the%20Power%20Users%20security%20group%20was%20considered%20by%20most%20to%20be%20the%20equivalent%20of%20the%20Administrators%20group.%20I%20knew%20the%20answer%20lay%20in%20the%20fact%20that%20default%20Windows%20permissions%20allow%20the%20group%20to%20modify%20specific%20Registry%20keys%20and%20files%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%3C%2FSPAN%3Ethat%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%3C%2FSPAN%3Eenable%20members%20of%20the%20group%20to%20elevate%20their%20privileges%20to%20that%20of%20the%20Local%20System%20or%20Administrators%20group%2C%20but%20I%20didn%E2%80%99t%20know%20of%20any%20concrete%20examples.%20I%20could%20have%20manually%20investigated%20the%20security%20on%20every%20file%2C%20directory%20and%20Registry%20key%2C%20but%20instead%20decided%20to%20write%20a%20utility%2C%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2Fsysinternals%2FUtilities%2FAccessChk.mspx%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2Fsysinternals%2FUtilities%2FAccessChk.mspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EAccessChk%20%3C%2FA%3E%2C%20that%20would%20answer%20questions%20like%20this%20automatically.%20AccessChk%20quickly%20showed%20me%20directories%2C%20files%2C%20keys%2C%20and%20even%20Windows%20services%20written%20by%20third%20parties%2C%20that%20Power%20Users%20could%20modify%20to%20cause%20an%20elevation%20of%20privilege.%20I%20posted%20my%20findings%20in%20my%20blog%20post%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fblogs.technet.com%2Fmarkrussinovich%2Farchive%2F2006%2F05%2F01%2Fthe-power-in-power-users.aspx%22%20mce_href%3D%22http%3A%2F%2Fblogs.technet.com%2Fmarkrussinovich%2Farchive%2F2006%2F05%2F01%2Fthe-power-in-power-users.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EThe%20Power%20in%20Power%20Users%20%3C%2FA%3E.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Since%20the%20posting%2C%20AccessChk%20has%20grown%20in%20popularity%20as%20a%20system%20security%20auditing%20tool%20that%20helps%20identify%20weak%20permissions%20problems.%20I%E2%80%99ve%20recently%20received%20requests%20from%20groups%20within%20Microsoft%20and%20elsewhere%20to%20extend%20its%20coverage%20of%20securable%20objects%20analyzed%20to%20include%20the%20Object%20Manager%20namespace%20(which%20stores%20named%20mutexes%2C%20semaphores%20and%20memory-mapped%20files)%2C%20the%20Service%20Control%20Manager%2C%20and%20named%20pipes.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20When%20I%20revisited%20the%20tool%20to%20add%20this%20support%2C%20I%20reran%20some%20of%20the%20same%20queries%20I%20had%20performed%20when%20I%20wrote%20the%20blog%20post%2C%20like%20seeing%20what%20system-global%20objects%20the%20Everyone%20and%20Users%20groups%20can%20modify.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20The%20ability%20to%20change%20those%20objects%20almost%20always%20indicates%20the%20ability%20for%20unprivileged%20users%20to%20compromise%20other%20accounts%2C%20elevate%20to%20system%20or%20administrative%20privilege%2C%20or%20prevent%20services%20or%20programs%20run%20by%20the%20system%20or%20other%20users%20from%20functioning.%20For%20example%2C%20if%20an%20unprivileged%20user%20can%20change%20an%20executable%20in%20the%20%25programfiles%25%20directory%20they%20might%20be%20able%20to%20cause%20another%20user%20to%20execute%20their%20code.%20Some%20applications%20include%20Windows%20services%2C%20so%20if%20a%20user%20could%20change%20the%20service%20executable%20they%20could%20obtain%20system%20privileges.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20size%3D%223%22%3E%20%3CFONT%20face%3D%22Calibri%22%3E%20These%20local%20elevation-of-privilege%20and%20denial-of-service%20holes%20are%20unimportant%20on%20single-user%20systems%20where%20the%20user%20is%20an%20administrator%2C%20but%20on%20systems%20where%20a%20user%20expects%20to%20be%20secure%20when%20running%20as%20a%20standard%20user%20(like%20Windows%20Vista)%2C%20and%20on%20shared%20computers%20like%20a%20family%20PCs%20that%20have%20unprivileged%20accounts%2C%20Terminal%20Server%20systems%2C%20and%20kiosk%20computers%2C%20they%20break%20down%20the%20security%20boundaries%20that%20Windows%20provides%20to%20separate%20unprivileged%20users%20from%20each%20other%20and%20from%20the%20system.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20%3C%2FFONT%3E%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20In%20my%20testing%20I%20executed%20AccessChk%20commands%20to%20look%20for%20potential%20security%20issues%20in%20each%20of%20the%20namespaces%20it%20supports.%20In%20the%20commands%20below%2C%20the%20-s%20option%20has%20AccessChk%20recurse%20a%20namespace%2C%20-w%20has%20it%20list%20only%20the%20objects%20for%20which%20the%20specified%20group%20%E2%80%93%20Everyone%20in%20the%20examples%20%E2%80%93%20has%20write%20access%2C%20and%20-u%20directs%20AccessChk%20to%20not%20report%20errors%20when%20it%20can%E2%80%99t%20query%20objects%20for%20which%20your%20account%20lacks%20permissions.%20The%20other%20switches%20indicate%20what%20namespace%20to%20examine%2C%20where%20the%20default%20is%20the%20file%20system.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%200.5in%22%3E%3CFONT%20size%3D%223%22%3E%3CFONT%20face%3D%22Calibri%22%3EFile%20system%3A%20%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3Eaccesschk%20everyone%20-wsu%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22mso-ascii-font-family%3A%20Courier%22%3E%3CFONT%20face%3D%22Calibri%22%3E%E2%80%9C%20%3C%2FFONT%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3E%25programfiles%25%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22mso-ascii-font-family%3A%20Courier%22%3E%3CFONT%20face%3D%22Calibri%22%3E%E2%80%9D%20%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%3B%20mso-hansi-font-family%3A%20Calibri%3B%20mso-hansi-theme-font%3A%20minor-latin%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3CFONT%20size%3D%223%22%3E%3CFONT%20face%3D%22Calibri%22%3EFile%20system%3A%20%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3Eaccesschk%20everyone%20-wsu%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22mso-ascii-font-family%3A%20Courier%22%3E%3CFONT%20face%3D%22Calibri%22%3E%E2%80%9C%20%3C%2FFONT%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3E%25systemroot%25%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22mso-ascii-font-family%3A%20Courier%22%3E%3CFONT%20face%3D%22Calibri%22%3E%E2%80%9D%20%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%3B%20mso-hansi-font-family%3A%20Calibri%3B%20mso-hansi-theme-font%3A%20minor-latin%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22Calibri%22%3E%3CFONT%20size%3D%223%22%3ERegistry%3A%20%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3Eaccesschk%20everyone%20-kwsu%20hklm%20%3CBR%20%2F%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22Calibri%22%3EProcesses%3A%20%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3Eaccesschk%20everyone%20-pwu%20*%20%3CBR%20%2F%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22Calibri%22%3ENamed%20Objects%3A%20%3CSPAN%20style%3D%22mso-tab-count%3A%201%22%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FFONT%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3Eaccesschk%20everyone%20-owu%20basenamedobjects%20%3CBR%20%2F%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22Calibri%22%3EServices%3A%20%3CSPAN%20style%3D%22mso-tab-count%3A%202%22%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3Eaccesschk%20everyone%20-cwu%20*%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%0A%20%20%20%20%0A%20%20%20%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%20ran%20similar%20commands%20looking%20for%20write%20access%20from%20the%20Authenticated%20Users%20and%20Users%20groups.%20An%20output%20line%2C%20which%20looks%20like%20%E2%80%9CRW%20C%3AProgram%20FilesVendor%E2%80%9D%2C%20reveals%20a%20probable%20security%20flaw.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20To%20my%20surprise%20and%20dismay%2C%20I%20found%20security%20holes%20in%20several%20namespaces.%20The%20security%20settings%20on%20one%20application%E2%80%99s%20global%20synchronization%20and%20memory%20mapping%20objects%2C%20as%20well%20as%20on%20its%20installation%20directory%2C%20allow%20unprivileged%20users%20to%20effectively%20shut%20off%20the%20application%2C%20corrupt%20its%20configuration%20files%2C%20and%20replace%20its%20executables%20to%20elevate%20to%20Local%20System%20privileges.%20What%20application%20has%20such%20grossly%20insecure%20permissions%3F%20Ironically%2C%20that%20of%20a%20top-tier%20security%20vendor.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20For%20instance%2C%20AccessChk%20showed%20output%20that%20indicated%20the%20Users%20group%20has%20write%20access%20to%20the%20application%E2%80%99s%20configuration%20directory%20(note%20that%20names%20have%20been%20changed)%3A%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20size%3D%223%22%3E%20%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3ERW%20C%3AProgram%20FilesSecurityVendorConfig%20%3CBR%20%2F%3ERW%20C%3AProgram%20Files%20SecurityVendorConfigscanmaster.db%20%3CBR%20%2F%3ERW%20C%3AProgram%20Files%20SecurityVendorConfigrealtimemaster.db%20%3CBR%20%2F%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22Calibri%22%3E%3CSPAN%20style%3D%22mso-ascii-font-family%3A%20Courier%22%3E%E2%80%A6%3C%2FSPAN%3E%3C%2FFONT%3E%20%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3E%20%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Because%20Malware%20would%20run%20in%20the%20Users%20group%2C%20it%20could%20modify%20the%20configuration%20data%20or%20create%20its%20own%20version%20and%20prevent%20the%20security%20software%20from%20changing%20it.%20It%20could%20also%20watch%20for%20dynamic%20updates%20to%20the%20files%20and%20reset%20their%20contents.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20For%20the%20object%20namespace%2C%20it%20reported%20output%20lines%20like%20this%3A%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20size%3D%223%22%3E%20%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3ERW%20%5BSection%5D%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%3C%2FSPAN%3Ebasenamedobjects12345678-abcd-1234-cdef-123456789abc%20%3CBR%20%2F%3ERW%20%5BMutant%5D%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%3C%2FSPAN%3Ebasenamedobjects87654321-cdab-3124-efcd-6789abc12345%20%3CBR%20%2F%3E%3C%2FSPAN%3E%3CFONT%20face%3D%22Calibri%22%3E%3CSPAN%20style%3D%22mso-ascii-font-family%3A%20Courier%22%3E%E2%80%A6%3C%2FSPAN%3E%3C%2FFONT%3E%20%3CSPAN%20style%3D%22FONT-FAMILY%3A%20Courier%22%3E%20%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%0A%20%20%20%20%20%0A%20%20%20%20%0A%20%20%20%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%20executed%20handle%20searches%20in%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2Fsysinternals%2FUtilities%2FProcessExplorer.mspx%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2Fsysinternals%2FUtilities%2FProcessExplorer.mspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EProcess%20Explorer%20%3C%2FA%3Eto%20determine%20which%20processes%20had%20these%20objects%20open%20and%20it%20reported%20those%20of%20the%20security%20software.%20Sections%20represent%20shared%20memory%20so%20it%20was%20likely%20that%20the%20security%20agent%2C%26nbsp%3Brunning%20in%20user%20login%20sessions%2C%20was%20using%20it%20to%20communicate%20data%20to%20the%20security%20software%E2%80%99s%20service%20process%20that%20was%20running%20in%20the%20Local%20System%20account.%20Malware%20could%20therefore%20modify%20the%20contents%20of%20the%20memory%2C%20possibly%20triggering%20a%20bug%20in%20the%20service%20to%20that%20might%20allow%20the%20malware%20to%20obtain%20administrative%20rights.%20At%20the%20minimum%20it%20could%20manipulate%20the%20data%20to%20foil%20the%20communication.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%E2%80%9CMutant%E2%80%9D%20is%20the%20internal%20name%20for%20Windows%20mutexes%2C%20and%20the%20security%20software%E2%80%99s%20service%20was%20using%20the%20mutex%20for%20synchronization.%20That%20means%20that%20malware%20could%20acquire%20the%20mutex%20and%20block%20forward%20progress%20by%20the%20service.%20There%20were%20more%20than%20few%20of%20these%20objects%20with%20wide-open%20security%20that%20could%20potentially%20be%20used%20to%20compromise%20or%20disable%20the%20security%20software.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20In%20the%20wake%20of%20my%20discovery%2C%20I%20analyzed%20the%20rest%20of%20my%20systems%2C%20as%20well%20as%20trial%20versions%20of%20other%20popular%20security%2C%20game%2C%20ISP%20and%20consumer%20applications.%20A%20number%20of%20the%20most%20popular%20in%20each%20category%20had%20problems%20similar%20to%20those%20of%20the%20security%20software%20installed%20on%20my%20development%20system.%20I%20felt%20like%20I%20was%20shining%20a%20flashlight%20under%20a%20house%20and%20finding%20rotten%20beams%20where%20I%20had%20assumed%20there%20was%20a%20sturdy%20foundation.%20The%20security%20research%20community%20has%20focused%20its%20efforts%20uncovering%20local%20elevations%20via%20buffer%20overflows%20and%20unverified%20parameters%2C%20but%20has%20completely%20overlooked%20these%20obvious%20problems%20%E2%80%93%20problems%20often%20caused%20by%20the%20software%20of%20security%20ISVs%2C%20or%20in%20some%20cases%2C%20their%20own.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Why%20are%20these%20holes%20created%3F%20I%20can%20only%20speculate%2C%20but%20because%20allowing%20unprivileged%20groups%20write-access%20to%20global%20objects%20requires%20explicit%20override%20of%20secure%20defaults%2C%20my%20guess%20is%20that%20they%20are%20common%20in%20software%20that%20was%20originally%20written%20for%20Windows%209x%20or%20assumed%20a%20single%20administrative%20user.%20When%20faced%20with%20permissions%20issues%20that%20crop%20up%20when%20migrating%20to%20a%20version%20of%20Windows%20with%20security%2C%20or%20that%20occur%20when%20their%20software%20is%20run%20by%20standard%20user%20accounts%2C%20the%20software%20developers%20have%20taken%20the%20easy%20way%20out%20and%20essentially%20turned%20off%20security.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Regardless%20of%20the%20reason%2C%20it%E2%80%99s%20time%20for%20software%20vendors%20%E2%80%93%20especially%20those%20of%20security%20applications%20-%20to%20secure%20their%20software.%20If%20you%20discover%20insecure%20software%20on%20your%20system%20please%20file%20a%20bug%20with%20the%20publisher%2C%20and%20if%20you%20are%20a%20software%20developer%20please%20follow%20the%20guidance%20in%20%22%20%3CA%20class%3D%22%22%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fmspress%2Fbooks%2F5957.aspx%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fmspress%2Fbooks%2F5957.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EWriting%20Secure%20Code%20%3C%2FA%3E%2C%E2%80%9D%20by%20Michael%20Howard%20and%20David%20LeBlanc.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-723569%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TechNet%20on%20Jun%2015%2C%202007%20A%20little%20over%20a%20year%20ago%20I%20set%20out%20to%20determine%20exactly%20why%2C%20prior%20to%20Window%20Vista%2C%20the%20Power%20Users%20security%20group%20was%20considered%20by%20most%20to%20be%20the%20equivalent%20of%20the%20Administrators%20group.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-723569%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMark%20Russinovich%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on TechNet on Jun 15, 2007

A little over a year ago I set out to determine exactly why, prior to Window Vista, the Power Users security group was considered by most to be the equivalent of the Administrators group. I knew the answer lay in the fact that default Windows permissions allow the group to modify specific Registry keys and files that enable members of the group to elevate their privileges to that of the Local System or Administrators group, but I didn’t know of any concrete examples. I could have manually investigated the security on every file, directory and Registry key, but instead decided to write a utility, AccessChk , that would answer questions like this automatically. AccessChk quickly showed me directories, files, keys, and even Windows services written by third parties, that Power Users could modify to cause an elevation of privilege. I posted my findings in my blog post The Power in Power Users .

Since the posting, AccessChk has grown in popularity as a system security auditing tool that helps identify weak permissions problems. I’ve recently received requests from groups within Microsoft and elsewhere to extend its coverage of securable objects analyzed to include the Object Manager namespace (which stores named mutexes, semaphores and memory-mapped files), the Service Control Manager, and named pipes.

When I revisited the tool to add this support, I reran some of the same queries I had performed when I wrote the blog post, like seeing what system-global objects the Everyone and Users groups can modify. The ability to change those objects almost always indicates the ability for unprivileged users to compromise other accounts, elevate to system or administrative privilege, or prevent services or programs run by the system or other users from functioning. For example, if an unprivileged user can change an executable in the %programfiles% directory they might be able to cause another user to execute their code. Some applications include Windows services, so if a user could change the service executable they could obtain system privileges.

These local elevation-of-privilege and denial-of-service holes are unimportant on single-user systems where the user is an administrator, but on systems where a user expects to be secure when running as a standard user (like Windows Vista), and on shared computers like a family PCs that have unprivileged accounts, Terminal Server systems, and kiosk computers, they break down the security boundaries that Windows provides to separate unprivileged users from each other and from the system.

In my testing I executed AccessChk commands to look for potential security issues in each of the namespaces it supports. In the commands below, the -s option has AccessChk recurse a namespace, -w has it list only the objects for which the specified group – Everyone in the examples – has write access, and -u directs AccessChk to not report errors when it can’t query objects for which your account lacks permissions. The other switches indicate what namespace to examine, where the default is the file system.

File system: accesschk everyone -wsu %programfiles%
File system: accesschk everyone -wsu %systemroot%
Registry: accesschk everyone -kwsu hklm
Processes:
accesschk everyone -pwu *
Named Objects:
accesschk everyone -owu basenamedobjects
Services: accesschk everyone -cwu *

I ran similar commands looking for write access from the Authenticated Users and Users groups. An output line, which looks like “RW C:Program FilesVendor”, reveals a probable security flaw.

To my surprise and dismay, I found security holes in several namespaces. The security settings on one application’s global synchronization and memory mapping objects, as well as on its installation directory, allow unprivileged users to effectively shut off the application, corrupt its configuration files, and replace its executables to elevate to Local System privileges. What application has such grossly insecure permissions? Ironically, that of a top-tier security vendor.

For instance, AccessChk showed output that indicated the Users group has write access to the application’s configuration directory (note that names have been changed):

RW C:Program FilesSecurityVendorConfig
RW C:Program Files SecurityVendorConfigscanmaster.db
RW C:Program Files SecurityVendorConfigrealtimemaster.db

Because Malware would run in the Users group, it could modify the configuration data or create its own version and prevent the security software from changing it. It could also watch for dynamic updates to the files and reset their contents.

For the object namespace, it reported output lines like this:

RW [Section] basenamedobjects12345678-abcd-1234-cdef-123456789abc
RW [Mutant] basenamedobjects87654321-cdab-3124-efcd-6789abc12345

I executed handle searches in Process Explorer to determine which processes had these objects open and it reported those of the security software. Sections represent shared memory so it was likely that the security agent, running in user login sessions, was using it to communicate data to the security software’s service process that was running in the Local System account. Malware could therefore modify the contents of the memory, possibly triggering a bug in the service to that might allow the malware to obtain administrative rights. At the minimum it could manipulate the data to foil the communication.

“Mutant” is the internal name for Windows mutexes, and the security software’s service was using the mutex for synchronization. That means that malware could acquire the mutex and block forward progress by the service. There were more than few of these objects with wide-open security that could potentially be used to compromise or disable the security software.

In the wake of my discovery, I analyzed the rest of my systems, as well as trial versions of other popular security, game, ISP and consumer applications. A number of the most popular in each category had problems similar to those of the security software installed on my development system. I felt like I was shining a flashlight under a house and finding rotten beams where I had assumed there was a sturdy foundation. The security research community has focused its efforts uncovering local elevations via buffer overflows and unverified parameters, but has completely overlooked these obvious problems – problems often caused by the software of security ISVs, or in some cases, their own.

Why are these holes created? I can only speculate, but because allowing unprivileged groups write-access to global objects requires explicit override of secure defaults, my guess is that they are common in software that was originally written for Windows 9x or assumed a single administrative user. When faced with permissions issues that crop up when migrating to a version of Windows with security, or that occur when their software is run by standard user accounts, the software developers have taken the easy way out and essentially turned off security.

Regardless of the reason, it’s time for software vendors – especially those of security applications - to secure their software. If you discover insecure software on your system please file a bug with the publisher, and if you are a software developer please follow the guidance in " Writing Secure Code ,” by Michael Howard and David LeBlanc.