On contrary to other databases Oracle does NOT allow plugins to access it's own memory address space. In case of MySQL/PostgreSQL a .dll plugin (C stored procedure) is loaded by the main database process.
Oracle lets listener to spawn a new process by calling extproc
(or extproc32
). This process loads the shared library and the rest of the database talks to this process via IPC.
This approach is safer, because the external library can not crash the database nor corrupt data. On the other hand sometimes C stored procedures might be slower than Java ones.
This option can restrict path for .dlls being loaded by extproc. i.e. those created by CREATE LIBRARY
statement.
PS: usage of C stored procedures is VERY rare, if you do not use them you can freely remove the whole extproc stanza from listener.ora.
PS1: there is possible scenario of exploiting the extproc
feature.
- User must have
CREATE LIBRARY
, which usually NOT granted
- extproc is not configured to run with nobody's privs - but runs as oracle:dba
- User creates malicious .so library, which will performs something "evil" during it's initialization.
- User puts this lib into /tmp directory
- User creates Oracle LIBRARY pointing into /tmp by using
CREATE LIBRARY
statement
- User forces
extproc
to dlopen
this library
exproc
will execute evil code with OS privileges oracle:dba
When using this EXTPROC_DLLS:ONLY
restriction, developers have to cooperate with DBAs, and only white-listed libraries can be used and loaded.