- 11 Jul, 2012 1 commit
-
-
Leigh Stoller authored
We had a couple of different problems actually. * We allow users to insert html into many DB fields (say, a project or experiment description). * We did not sanitize that output when displaying back. * We did not sanitize initial page arguments that were reflected in the output (say, in a form). Since no one has the time to analyze every line of code, I took a couple of shortcuts. The first is that I changed the regex table to not allow any <> chars to go from the user into the DB. Brutal, but in fact there are only a couple of places where a user legitimately needs them. For example, a startup command that includes redirection. I handle those as special cases. As more come up, we can fix them. I did a quick pass through all of the forms, and made sure that we run htmlspecialchars on everything including initial form args. This was not too bad cause of the way all of the forms are structured, with a "formfields" array. I also removed a bunch of obsolete code and added an update script to actually remove them from the www directory. Lastly, I purged some XMLRPC code I did a long time ago in the Begin Experiment path. Less complexity, easier to grok and fix. modified: sql/database-fill.sql modified: sql/dbfill-update.sql
-
- 13 Nov, 2007 1 commit
-
-
Russ Fish authored
-
- 24 Oct, 2007 1 commit
-
-
Russ Fish authored
-
- 27 Sep, 2007 1 commit
-
-
Russ Fish authored
www/newmmlist.php3 - The reworked PHP page. backend/{newmmlist,GNUmakefile}.in configure configure.in - New backend script. sql/database-fill.sql - Add table_regex 'mailman_lists' checking patterns.
-
- 12 Feb, 2007 1 commit
-
-
Leigh Stoller authored
register_globals=1 to turn POST/GET/COOKIES arguments in local variables. This is known to be a terrible security risk, and we keep saying we are going to fix it, and now I am. In order to accomplish this on a transitional basis (since I don't want the entire web interface to stop working while I debug it), and because the code just needs the cleanup, I am doing it like this: Each page will sport new declarations at the top: RequiredPageArguments("experiment", PAGEARG_EXPERIMENT, "template", PAGEARG_TEMPLATE, "instance", PAGEARG_INSTANCE, "metadata", PAGEARG_METADATA, "osinfo", PAGEARG_OSINFO, "image", PAGEARG_IMAGE, "project", PAGEARG_PROJECT, "group", PAGEARG_GROUP, "user", PAGEARG_USER, "node", PAGEARG_NODE, "yesno", PAGEARG_BOOLEAN, "message", PAGEARG_STRING, "age", PAGEARG_INTEGER, "cost", PAGEARG_NUMERIC, "formfields", PAGEARG_ARRAY, "unknown", PAGEARG_ANYTHING); OptionalPageArguments("canceled", PAGEARG_BOOLEAN); The first token in each pair is the name of the global variable to set, and the second token is the type. So, for "experiment" we look at the URL for a pid/eid or exptidx, etc, sanity check them (safe for a DB query), and then try to find that experiment in the DB. If it maps to an experiment, set global variable $experiment to the object. Since its a required argument, produce an error if not supplied. Similar treatment for optional arguments, with the obvious difference. The goal is to have ALL argument processing in one place, consistent, and correct. I've found numerous places where we leak unchecked arguments into queries. It also cuts out a lot of duplicated code. * To make the above easier to deal with, I've been replacing lots of hardcoded URLS in the code of the form: foo.php3?pid=$pid&eid=$eid ... with CreateURL("foo", $experiment) which creates and returns the neccessary url string, by looking at the type of its arguments (experiment, template, instance, etc.) Eventually plan to replace them all so that URL handling throughout the code is all defined in one place (all the new URL code is in url_defs.php). * I have cranked up error reporting to tell me anytime a variable is used before it is initialized, plus a bunch of other stuff that PHP deems improper. Think of it like -Wall ... and boy we get a lot of warnings. A very large percentage of the diffs are to fix all these warnings. The warnings are currently going to /usr/testbed/log/php-errors.log, and I'll be adding a script to capture them each night and mail them to tbops. This file also gets errors (this will be a change for developers; rather then seeing errors and warnings dumped in the middle of web pages, they will go to this file instead). * Major refactoring of the code. More objects (nodes, images, osids). Moving tons of queries into the objects in the hopes of someday getting to a point where we can split the web interface onto a different server. Lots of general cleanup.
-
- 09 Jan, 2007 1 commit
-
-
Leigh Stoller authored
most of the rest of the tables in the system (still a few exceptions). Bound to be some bugs ...
-
- 20 Dec, 2006 1 commit
-
-
Leigh Stoller authored
converting to locally unique ids and later globally unique ids.
-
- 08 Sep, 2005 2 commits
-
-
Leigh Stoller authored
-
Leigh Stoller authored
described elsewhere ... Note that until Jay approves the new menu config, mere users will *not* see the new collaboration menu. Only STUDLY() users will see the new menu, although everyone will see the rest of the front page menu changes since they are fairly minor.
-
- 15 Aug, 2005 1 commit
-
-
Leigh Stoller authored
Jay has "comments"), but I do not want it hanging around in my source tree. Here is my mail message: * The "My Mailing Lists" is context sensitive (copied from Tim's changes to the My Bug Databases). It takes you to the *archives* for the current project (or subgroup) list. Or it takes you to your first joined project. * The showproject and showgroup pages have direct links to the project and group specific archives. If you are in reddot mode, you also get a link to the admin page for the list. Note that project and group leaders are just plain members of these lists. * The interface to create a new "user" list is: https://www.emulab.net/dev/stoller/newmmlist.php3 We do not store the password, but just fire it over in the list creation process. Anyone can create their own mailing lists. They are not associated with projects, but just the person creating the list. That person is the list administrator and is given permission to access the configuration page. This page is not hooked in yet; not sure where. * Once you have your own lists, you user profile page includes a link in the sub menu: Show Mailman Lists. From this page you can delete lists, zap to the admin page, or change the admin password (which is really just a subpage of the admin page). * As usual, in reddot mode you can mess with anyone else's mailman lists, (via the magic of mailman cookies). * Note on cross machine login. The mailman stuff has a really easy way to generate the right kind of cookie to give users access. You can generate a cookie to give user access, or to the admin interface for a list (a different cookie). Behind the scenes, I ssh over and get the cookie, and set it in the user's browser from boss. When the browser is redirected over to ops, that cookie goes along and gives the user the requested access. No passwords need be sent around, since we do the authentication ourselves.
-