Unhandled SecurityException because ADXRegistry.OpenKey between Contructor call and AddinModule_AddinInitialize

Add-in Express™ Support Service
That's what is more important than anything else

Unhandled SecurityException because ADXRegistry.OpenKey between Contructor call and AddinModule_AddinInitialize
 
Gutek Jakub




Posts: 39
Joined: 2017-06-06
Hi,

this is a continuation of SecurityException - OpenKey

Basically this issue starts to be encounter by more and more users. Logging with generatingLogFile for loader does not add anything interesting. It looks like this exception occurs between Constructor call and AddinModule_AddinInitialize method call, or at least this what I can figure out looking at my custom log file. But for sure its not going into AddinModule_OnError.

The issue is quite important as security team says its not their issue as its thrown by our software, we are saying that this is not our plugin as this is something that Addin Express is trying to run during loading of the plugin and user seams that does not have access to registry key. This is a ping pong and we need to be able to show that this is truly a security/permission issue or find a cause of this in adding express. As only our Plugin throws this exception. all other plugins that user have installed, does not generate permission issue.

What can we do?
- logging file from loader doesn't log this
- our logging that is attached to AddinModule_OnError doesn't catch it.

here is an log file from generatingLogFile:


Add-in Express Loader Log File: 03/12/2020 13:17:20:016

Startup directory: C:UsersuserAppDataLocalcompanyplugin
Loader version: 9.4.4644.0
Operating System: Microsoft Windows 10 Enterprise Edition (build 17134), 64-bit
Process Owner: Administrator
Command Line: "C:Program Files (x86)Microsoft Office
ootOffice16OUTLOOK.EXE" 
Run 'As Administrator': No
Process Elevated: No
Integrity Level: Medium
UAC (User Account Control): On
------------------------------------------------------------------------
13:17:20:021 5728 13208 Start.
13:17:20:022 5728 13208 The minimum supported Office version is 12
13:17:20:022 5728 13208 The host's version is 16.0.12325.20298
13:17:20:022 5728 13208 Creating a new instance of the add-in loader.
13:17:20:022 5728 13208 Loading mscoree.dll
13:17:20:022 5728 13208 INFO: Assembly codebase - C:UsersuserAppDataLocalcompanypluginOur.Software.Plugin.dll.
13:17:20:025 5728 13208 INFO: Assembly version - 2.4.0.5.
13:17:20:025 5728 13208 Success.
13:17:20:025 5728 13208 Loading the configuration from the system registry.
13:17:20:026 5728 13208 Getting the latest CLR version.
13:17:20:027 5728 13208 The latest CLR version is 'v4.0.30319'.
13:17:20:027 5728 13208 The configuration has been loaded successfully.
13:17:20:027 5728 13208     Runtime version: v4.0.30319.
13:17:20:027 5728 13208     Assembly name: Our.Software.Plugin, PublicKeyToken=XXX.
13:17:20:027 5728 13208     Class name: Our.Software.Plugin.AddinModule.
13:17:20:027 5728 13208     Registry key: CLSID{90EDD4E4-593D-4552-9E0C-A244B7356ABF}.
13:17:22:252 5728 13208 Attempting to create a new instance of the managed add-in class: CLR - v4.0.30319
13:17:22:252 5728 13208 Loading CLR: v4.0.30319.
13:17:22:253 5728 13208 Calling CLRCreateInstance method.
13:17:22:253 5728 13208 Success.
13:17:22:253 5728 13208 Calling GetRuntime method.
13:17:22:253 5728 13208 Success.
13:17:22:253 5728 13208 Checking if the hosting API of .NET Framework v4.0 beta is installed.
13:17:22:253 5728 13208 The hosting API is up to date.
13:17:22:253 5728 13208 Calling SetDefaultStartupFlags method.
13:17:22:253 5728 13208 Success.
13:17:22:253 5728 13208 Calling GetInterface method for the CorRuntimeHost interface.
13:17:22:253 5728 13208 Success.
13:17:22:253 5728 13208 Starting CLR...
13:17:22:253 5728 13208 Success.
13:17:22:253 5728 13208 Getting the CLR version.
13:17:22:253 5728 13208 The CLR v4.0.30319 has been initialized successfully.
13:17:22:316 5728 13208 Creating a new domain setup.
13:17:22:316 5728 13208 Success.
13:17:22:316 5728 13208 Getting the add-in directory.
13:17:22:316 5728 13208 Success. The directory is 'C:UsersuserAppDataLocalcompanyplugin'
13:17:22:316 5728 13208 The 'shadow copy' is disabled.
13:17:22:316 5728 13208 Creating a new application domain.
13:17:22:318 5728 13208 Success.
13:17:22:318 5728 13208 Creating an instance of the managed class. Assembly identity: 'Our.Software.Plugin, PublicKeyToken=XXX'
13:17:22:765 5728 13208 Success.
13:17:22:765 5728 13208 Unwrapping the managed class.
13:17:22:834 5728 13208 Success.
13:17:22:834 5728 13208 Querying the add-in extensibility.
13:17:22:834 5728 13208 Success.
13:17:22:834 5728 13208 Querying the custom task panes.
13:17:22:834 5728 13208 Success.
13:17:22:834 5728 13208 Querying the ribbon extensibility.
13:17:22:834 5728 13208 Success.
13:17:22:834 5728 13208 Querying the form regions.
13:17:22:835 5728 13208 Success.
13:17:22:835 5728 13208 Querying the encryption provider.
13:17:22:835 5728 13208 The 'EncryptionProvider' interface is not supported.
13:17:22:835 5728 13208 Getting the dispid of the 'Dispose' method.
13:17:22:838 5728 13208 Success.
13:17:22:838 5728 13208 Getting the dispid of the 'InitializeLoaderService' method.
13:17:22:838 5728 13208 Success.
13:17:22:838 5728 13208 Invoking the 'InitializeLoaderService' method.
13:17:22:838 5728 13208 Success.
13:17:22:838 5728 13208 The instance of the managed add-in class has been created successfully.

Startup directory: C:UsersuserAppDataLocalcompanyplugin
Loader version: 9.4.4644.0
Operating System: Microsoft Windows 10 Enterprise Edition (build 17134), 64-bit
Process Owner: Administrator
Command Line: "C:Program Files (x86)Microsoft OfficeRootOffice16EXCEL.EXE" "\serverpathile.xlsx"
Run 'As Administrator': No
Process Elevated: No
Integrity Level: Medium
UAC (User Account Control): On
------------------------------------------------------------------------
13:18:44:917 4840 14948 Start.
13:18:44:917 4840 14948 The minimum supported Office version is 12
13:18:44:917 4840 14948 The host's version is 16.0.12325.20298
13:18:44:917 4840 14948 Creating a new instance of the add-in loader.
13:18:44:917 4840 14948 Loading mscoree.dll
13:18:44:918 4840 14948 INFO: Assembly codebase - C:UsersuserAppDataLocalcompanypluginOur.Software.Plugin.dll.
13:18:44:920 4840 14948 INFO: Assembly version - 2.4.0.5.
13:18:44:920 4840 14948 Success.
13:18:44:920 4840 14948 Loading the configuration from the system registry.
13:18:44:921 4840 14948 Getting the latest CLR version.
13:18:44:921 4840 14948 The latest CLR version is 'v4.0.30319'.
13:18:44:921 4840 14948 The configuration has been loaded successfully.
13:18:44:921 4840 14948     Runtime version: v4.0.30319.
13:18:44:921 4840 14948     Assembly name: Our.Software.Plugin, PublicKeyToken=XXX.
13:18:44:921 4840 14948     Class name: Our.Software.Plugin.AddinModule.
13:18:44:921 4840 14948     Registry key: CLSID{90EDD4E4-593D-4552-9E0C-A244B7356ABF}.
13:18:44:921 4840 14948 Attempting to create a new instance of the managed add-in class: CLR - v4.0.30319
13:18:44:921 4840 14948 Loading CLR: v4.0.30319.
13:18:44:921 4840 14948 Calling CLRCreateInstance method.
13:18:44:921 4840 14948 Success.
13:18:44:921 4840 14948 Calling GetRuntime method.
13:18:44:923 4840 14948 Success.
13:18:44:923 4840 14948 Checking if the hosting API of .NET Framework v4.0 beta is installed.
13:18:44:951 4840 14948 The hosting API is up to date.
13:18:44:952 4840 14948 Calling SetDefaultStartupFlags method.
13:18:44:952 4840 14948 Success.
13:18:44:952 4840 14948 Calling GetInterface method for the CorRuntimeHost interface.
13:18:44:952 4840 14948 Success.
13:18:44:952 4840 14948 Starting CLR...
13:18:44:952 4840 14948 Success.
13:18:44:952 4840 14948 Getting the CLR version.
13:18:44:952 4840 14948 The CLR v4.0.30319 has been initialized successfully.
13:18:45:050 4840 14948 Creating a new domain setup.
13:18:45:052 4840 14948 Success.
13:18:45:052 4840 14948 Getting the add-in directory.
13:18:45:052 4840 14948 Success. The directory is 'C:UsersuserAppDataLocalcompanyplugin'
13:18:45:052 4840 14948 The 'shadow copy' is disabled.
13:18:45:052 4840 14948 Creating a new application domain.
13:18:45:058 4840 14948 Success.
13:18:45:058 4840 14948 Creating an instance of the managed class. Assembly identity: 'Our.Software.Plugin, PublicKeyToken=XXX'
13:18:45:431 4840 14948 Success.
13:18:45:431 4840 14948 Unwrapping the managed class.
13:18:45:475 4840 14948 Success.
13:18:45:475 4840 14948 Querying the add-in extensibility.
13:18:45:476 4840 14948 Success.
13:18:45:476 4840 14948 Querying the custom task panes.
13:18:45:476 4840 14948 Success.
13:18:45:476 4840 14948 Querying the ribbon extensibility.
13:18:45:476 4840 14948 Success.
13:18:45:476 4840 14948 Querying the form regions.
13:18:45:476 4840 14948 Success.
13:18:45:476 4840 14948 Querying the encryption provider.
13:18:45:476 4840 14948 The 'EncryptionProvider' interface is not supported.
13:18:45:476 4840 14948 Getting the dispid of the 'Dispose' method.
13:18:45:479 4840 14948 Success.
13:18:45:479 4840 14948 Getting the dispid of the 'InitializeLoaderService' method.
13:18:45:479 4840 14948 Success.
13:18:45:479 4840 14948 Invoking the 'InitializeLoaderService' method.
13:18:45:479 4840 14948 Success.
13:18:45:479 4840 14948 The instance of the managed add-in class has been created successfully.



Any help will be much appreciated.

as we are all under convid-19 restriction, the question for testing on the user might take longer than usual, however even usual its not considered fast.
Posted 28 Apr, 2020 16:52:28 Top
Andrei Smolin


Add-in Express team


Posts: 17438
Joined: 2006-05-11
Hello Jakub,

Could you please provide adxregistrator.log as well? If you follow the instruction given in section Deploying a per-user Office extension via an MSI installer - see the PDF file in the folder {Add-in Express}\Docs on your development PC - then your user don't have access to that registry key. To check this, I would test a new empty add-in or a Windows Forms application accessing that key.

Can it be that users have Office installed from Microsoft Store (check https://www.add-in-express.com/creating-addins-blog/2019/02/27/office-from-store-issues/)?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Apr, 2020 04:31:58 Top
Gutek Jakub




Posts: 39
Joined: 2017-06-06
Thanks, will ask a user to provide a adxregistrator log file.

I have no access to the user or user computer, only IT team have admin access to that computers and they say that security permissions are ok and are the same as of the others (i do not agree with this statement, and I need to prove it somehow as otherwise, it will be said that this is an issue with a plugin). Therefore we are dev and support team can't verify permission to registry keys.

Thanks for the info about the store, as far as I know, it's not. this is a big corp, all software is managed by separate IT team that install it using exe installation files but will confirm this.

cheers
Posted 29 Apr, 2020 05:51:10 Top
Andrei Smolin


Add-in Express team


Posts: 17438
Joined: 2006-05-11
If they install a per-user thing using admin permissions, they actually install it for themselves, not for the user.

The log file is either in {user profile who run the installer}\AppData\Local\Temp\<ProductName>\adxregistrator.log or in the file specified by the parameters passed to adxregistrator.exe; see custom actions of your setup project.

Gutek Jakub writes:
about the store, as far as I know, it's not


That Office version can be deployed on the corporate level; Microsoft allows this.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Apr, 2020 07:07:57 Top