Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Usage of SP_OACreate, SP_OAMethod etc.. is a security risk?

I am told that usage of SP_OACreate , SP_OAMethod in SQL Server 2000 is of a security risk.

I am using Strong Name in the assembly and is stored in GAC on the SQL Server Machine.

What are the security implications/compromise ?

like image 307
TonyP Avatar asked Sep 02 '25 06:09

TonyP


1 Answers

These extended stored procedures allow one to instantiate an OLE ("ActiveX") object from inside SQL Server. A typical use case creating an MSXML object and having it send some database data as an HTTP POST.

In my mind, there are two issues with the sp_OACreate etc procedures:

  • Only principals in the sysadmin role can execute these by default. Granting and testing these permissions is a pain. (You have to add the user to the Master database and grant them permissions in that database.)

  • The permission granted is very broad. You can't just say "ok user, you have the right to create this kind of object and do xyz with it." Instead you say "ok user, you have the right to create any OLE object you want and do anything you want." That is a pretty broad canvas.

like image 146
Robert Calhoun Avatar answered Sep 04 '25 23:09

Robert Calhoun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!