X-Git-Url: https://git.distorted.org.uk/~mdw/userv-utils/blobdiff_plain/9a7d9296e965c2c9da647e3e8d6f1457458b863e..0324503152d6edb67572b45225745441913ae55e:/www-cgi/user-cgi.text?ds=sidebyside diff --git a/www-cgi/user-cgi.text b/www-cgi/user-cgi.text index 88676ea..464686b 100644 --- a/www-cgi/user-cgi.text +++ b/www-cgi/user-cgi.text @@ -1,23 +1,17 @@ -Users can now arrange to have CGI scripts run by chiark's webserver. -This is achieved using userv (see /info/new 183, /usr/doc/userv and +Users can arrange to have CGI scripts run by the webserver. +This is achieved using userv (see ). Before you write such scripts you should be aware of the security -issues involved. Please read /info/cgi-security.text ! +issues involved. -Note that public-cgi programs (and their source code) should be world -readable, and in any case by creating them you give me implicit -permission to read its contents, using my system privilege if -necessary, without notifying you. See cgi-security.text for full -details of the policy. - -Paths in chiark's http space of the form +Paths in the http space of the form /ucgi/~//... will be taken to refer to the CGI script ~/public-cgi/ and / will be used as the PATH_INFO (as is conventional). For example, - http://www.chiark.greenend.org.uk/ucgi/~ijackson/spong/foo?bar=baz + http://www.example.com/ucgi/~ijackson/spong/foo?bar=baz will run ~ijackson/public-cgi/spong with PATH_INFO set to `/foo' and QUERY_STRING set to `bar=baz'. @@ -27,12 +21,9 @@ which will return a text/plain document consisting of the standard output and standard error of your script and a line at the bottom with the high and low bytes of the script's exit status. -Also both of - http://www.chiark.greenend.org.uk/ucgicgi/check - http://www.chiark.greenend.org.uk/ucgi/~ijackson/check -are scripts which will dump their arguments and environment as a -text/plain output file. This can be used to see what input your CGI -program ought to expect. +Also, /usr/local/lib/user-cgi/cgi/check is a script which will dump +its arguments and environment as a text/plain output file. This can +be used to see what input your CGI program ought to expect. The default configuration does not enable userv's `set-environment' feature, so the environment your scripts in will be rather minimal. @@ -50,10 +41,9 @@ and other similar variables will be set correctly (see below) and can and should be trusted. However, their arguments, input and webserver-provided environment -variables (the full list is in /usr/local/src/davenant/ucgicommon.c) -will have come from the client WWW browser and are highly -untrustworthy. This means you must be very careful when writing such -programs. Beware particularly of +variables (the full list is in ucgicommon.c) will have come from the +client WWW browser and are highly untrustworthy. This means you must +be very careful when writing such programs. Beware particularly of * buffer overruns in C * trusting data not to have metacharacters. You should generally not pass client-provided data to @@ -65,7 +55,8 @@ programs. Beware particularly of Safely using untrusted client-provided data in shell scripts is very difficult. I would recommend against programming CGI scripts in shell. If you must, make sure you use appropriate quoting and -argument unparsing everywhere. +argument unparsing everywhere (and don't do it if you don't know what +I mean by argument unparsing). The invocation of user-provided CGI scripts is achieved by using userv to invoke the `www-cgi' service. The webserver-provided environment @@ -90,7 +81,26 @@ You can run your own scripts from the command line by saying CGI programs' path components may not be empty, may not start with a full stop `.', and may not end with a hash `#' or tilde `~'. -Please report problems to webmaster@chiark or sysadmin@chiark. -Comments on userv should go to userv-maint@chiark.greenend.org.uk. +It is important that the webserver removes /../ components from the +PATH_INFO - if it doesn't there is a security hole. + + +userv-utils are +Copyright 1996-2013 Ian Jackson +Copyright 1998 David Damerell +Copyright 1999,2003 + Chancellor Masters and Scholars of the University of Cambridge +Copyright 2010 Tony Finch + +All the utilities here are free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. - - Ian Jackson 14.07.1998 +You should have received a copy of the GNU General Public License +along with userv-utils; if not, see http://www.gnu.org/licenses/.