Introduction:
I am currently developing document classifier software in C / C ++, and I will use the naive Bayes class model for classification. But I wanted users to use any algorithm they want (or I want in the future), so I went to separate the part of the algorithm from the architecture as a plugin that will be attached to the main app of the @app application. Therefore, any user can write their own algorithm as a plugin and use it with my application.
Problem:
The way I am going to develop this is to have each of the algorithms that the user wants to use to be included in a DLL file and placed in a specific directory. And at the beginning, my application will look for all the DLLs in this directory and load them.
My questions:
(1) What should I do if the malicious code is created as a DLL (and it will have the same functions that are provided by the plugins) and placed in my plugins directory? In this case, my application will think that its plugin selects it and calls it functions, so malicious code can easily bring my entire application down (in the worst case, my application can be launched as malicious code !!!).
(2) Is the use of a DLL the only available for implementing a plugin design pattern? (Not only because of fear of a malicious plugin, but also because of its general question out of curiosity :))
(3) I think many software tools are written using the plugin model for extensibility, if so, how are they protected from such attacks?
(4) In general, what do you think of my decision to use the plugin model for extension (do you think I should look at any other alternatives?)
thanks
-MicroKernel :)
source share