You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/27 02:56:29 UTC

[GitHub] [apisix] soulbird opened a new issue #6729: feat: As a user, I hope apisix can make some restrictions on the custom functions in the serverless plugin, and the use of illegal code will not cause the apisix service to be unavailable

soulbird opened a new issue #6729:
URL: https://github.com/apache/apisix/issues/6729


   ### Description
   
   I noticed that the serverless plugin allows users to run custom functions, but it doesn't seem to have any restrictions. Some illegal code of the user may cause the apisix service to be unavailable. for example
   ```bash
   curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/index.html",
       "plugins": {
           "serverless-pre-function": {
               "phase": "rewrite",
               "functions" : ["return function() ngx.ctx.api_ctx = nil; end"]
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "127.0.0.1:1980": 1
           }
       }
   }'
   ```
   And when you request apisix, it won't work
   ```bash
   curl -v http://127.0.0.1:9080/index.html
   
   *   Trying 127.0.0.1:9080...
   * Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
   > GET /index.html HTTP/1.1
   > Host: 127.0.0.1:9080
   > User-Agent: curl/7.77.0
   > Accept: */*
   > 
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 500 Internal Server Error
   < Date: Sun, 27 Mar 2022 02:28:10 GMT
   < Content-Type: text/html; charset=utf-8
   < Transfer-Encoding: chunked
   < Connection: close
   < Server: APISIX/2.12.0
   < 
   <!DOCTYPE html>
   <html>
   <head>
   <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
   <meta content="utf-8" http-equiv="encoding">
   <title>500 Internal Server Error</title>
   <style>
       body {
           width: 35em;
           margin: 0 auto;
           font-family: Tahoma, Verdana, Arial, sans-serif;
       }
   </style>
   </head>
   <body>
   ```
   
   This is just a simple example, hackers may have many more ways to exploit this vulnerability to attack your system.
   
   So, I think apisix can make some restrictions on custom functions in serverless plugins to ensure that they run in a more secure environment.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] soulbird commented on issue #6729: feat: As a user, I hope apisix can make some restrictions on the custom functions in the serverless plugin, and the use of illegal code will not cause the apisix service to be unavailable

Posted by GitBox <gi...@apache.org>.
soulbird commented on issue #6729:
URL: https://github.com/apache/apisix/issues/6729#issuecomment-1080125716


   > We may introduce a simple sandbox mechanism firstly, such as make vital data read-only and only allow users to execute write operations in a specific space.
   
   LGTM!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] soulbird commented on issue #6729: feat: As a user, I hope apisix can make some restrictions on the custom functions in the serverless plugin, and the use of illegal code will not cause the apisix service to be unavailable

Posted by GitBox <gi...@apache.org>.
soulbird commented on issue #6729:
URL: https://github.com/apache/apisix/issues/6729#issuecomment-1081298579


   > 
   
   sure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] soulbird commented on issue #6729: feat: As a user, I hope apisix can make some restrictions on the custom functions in the serverless plugin, and the use of illegal code will not cause the apisix service to be unavailable

Posted by GitBox <gi...@apache.org>.
soulbird commented on issue #6729:
URL: https://github.com/apache/apisix/issues/6729#issuecomment-1081298737


   > @soulbird Would you like to write a proposal to the mailing list? Let's get further discussion there.
   
   sure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] soulbird removed a comment on issue #6729: feat: As a user, I hope apisix can make some restrictions on the custom functions in the serverless plugin, and the use of illegal code will not cause the apisix service to be unavailable

Posted by GitBox <gi...@apache.org>.
soulbird removed a comment on issue #6729:
URL: https://github.com/apache/apisix/issues/6729#issuecomment-1081298579


   > 
   
   sure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tokers commented on issue #6729: feat: As a user, I hope apisix can make some restrictions on the custom functions in the serverless plugin, and the use of illegal code will not cause the apisix service to be unavailable

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #6729:
URL: https://github.com/apache/apisix/issues/6729#issuecomment-1080090130


   We may introduce a simple sandbox mechanism firstly, such as make vital data read-only and only allow users to execute write operations in a specific space.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tokers commented on issue #6729: feat: As a user, I hope apisix can make some restrictions on the custom functions in the serverless plugin, and the use of illegal code will not cause the apisix service to be unavailable

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #6729:
URL: https://github.com/apache/apisix/issues/6729#issuecomment-1080421031


   @soulbird Would you like to write a proposal to the mailing list? Let's get further discussion there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org