Jump to content

Recommended Posts

I have a PHP app that I would like to allow users to write custom extensions for.  I currently only allow my hosted solution, so for me to allow users to upload custom PHP classes as extensions, I need to limit the functionality of those classes.  I would want to make sure they don't have any access to the database, file system, etc.

 

The custom PHP classes would have to interface one of my interface classes so all data/information the custom class would need is passed when called.

 

Is there a way to do this?

 

Link to comment
https://forums.phpfreaks.com/topic/282580-php-class-limit-access/
Share on other sites

As soon as you allow people to write custom PHP code that interacts with yours, the security of your application is lost entirely.

 

My advice: document a set of APIs (interfaces) and rules custom code must follow, then allow them to submit it to you for a manual screening and approval process.

 


As soon as you allow people to write custom PHP code that interacts with yours, the security of your application is lost entirely.

 

+435

 

And besides that ; PHP simply doesn't have any way to control accessrights on a per-script basis. You can configure PHP per webserver instance, but then your code would have to obey the same restrictions.

 

 


document a set of APIs (interfaces) and rules custom code must follow, then allow them to submit it to you for a manual screening and approval process. 

 

And even then there's a very good chance that you miss somthing as simple as a memory leak, or an fsock that acts ike a fileserver to warez sites.

 

Nah, keep the customer's code on the customer's site. Give them an HTTP-based API so they can request information and send new data to your application but do *NOT* let them run their own code on your server.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.