web2pyTM Main Features

  • Model-View-Controller design (similar to Ruby-on-Rails/Django/Pylons/Turbogears).
  • No installation required. download and click on runme (.py, .app, or .exe)
  • Very easy to use (no need to type shell commands!).
  • Full web based application development, deployment and administration.
  • Multiple concurrent applications each with its own folders, sessions, static files, error logs, etc.
  • Built-in internationalization. Example:
    1.
    T("hello world")
  • Ticketing system for reporting and logging errors (and make sure code is never exposed to users).
  • View/Template language with full Python support but with no indentation requirements. Example:
    1.
    2.
    {{extend 'layout.html'}}
    {{
    for i in range(10):}}hello{{pass}}
  • Database Abstraction Layer for interfacing the database in Python without SQL. Works with SQLite3, PostgreSQL, MySQL, MSSQL, FireBird, and Oracle. It can do joins, orderby, groupby and limitby. Example:
    1.
    2.
    db.define_table('users',SQLField('name'))
    db().select(db.users.name)
  • A database administrative interface to browse, insert, edit, update and delete records. It also allows import/export in csv.
  • Helpers for building HTML (including FORMs, SQLFORMs and SQLTABLEs). Example:
    1.
    form=SQLFORM(db.users)
  • FORMs and SQLFORMs perform validation of input. Example:
    1.
    2.
    if form.accepts(response.vars,session):
    response.flash='record inserted'
  • Supports database migrations (with PostgreSQL, partially with sqlite)
  • Designed for security. URLs are validated, forms are validated, template variables are escaped, SQL is escaped, no client side storage (other than session cookie) and it never exposes application code. FORMs enforce navigation and prevent double submission.
  • A powerful and granular cache system can cache in ram/disk/both a single function, a database select, a controller or an entire page.
  • Does not require any third party library. Only Python 2.5 standard libraries.
  • Runs on Google App Engine
  • Includes libraries to read and parse RSS, CSV, JSON and to write RTF.
  • Applications can be compiled and distributed without source code
  • WGSI compliant.

Top 10 security issues according to OWASP and what web2py does about them


A1 - Cross Site Scripting (XSS) XSS flaws occur whenever an application takes user supplied data and sends it to a web browser without first validating or encoding that content. XSS allows attackers to execute script in the victim's browser which can hijack user sessions, deface web sites, possibly introduce worms, etc.
web2py, by default, escapes all variables rendered in the view, thus preventing XSS.

A2 - Injection Flaws Injection flaws, particularly SQL injection, are common in web applications. Injection occurs when user-supplied data is sent to an interpreter as part of a command or query. The attacker's hostile data tricks the interpreter into executing unintended commands or changing data.
web2py includes an Object Relation Mapper that makes SQL injection impossible.

A3 - Malicious File Execution Code vulnerable to remote file inclusion (RFI) allows attackers to include hostile code and data, resulting in devastating attacks, such as total server compromise. Malicious file execution attacks affect PHP, XML and any framework which accepts filenames or files from users.
web2py allows only exposed controllers to be executed and thus prohibits malicious file execution.

A4 - Insecure Direct Object Reference A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, database record, or key, as a URL or form parameter. Attackers can manipulate those references to access other objects without authorization.
web2py does not exposes any internal object, moreover web2py validates all URLs thus preventing directory traversal attacks.

A5 - Cross Site Request Forgery (CSRF) A CSRF attack forces a logged-on victim's browser to send a pre-authenticated request to a vulnerable web application, which then forces the victim's browser to perform a hostile action to the benefit of the attacker. CSRF can be as powerful as the web application that it attacks.
web2py only uses session cookies and prevents double submission of forms.

A6 - Information Leakage and Improper Error Handling Applications can unintentionally leak information about their configuration, internal workings, or violate privacy through a variety of application problems. Attackers use this weakness to steal sensitive data, or conduct more serious attacks.
web2py is the only framework to provide a built-in ticketing system. No error can result in code being exposed to users. All errors are logged and a ticket is issued to the user to allow error tracking.

A7 - Broken Authentication and Session Management Account credentials and session tokens are often not properly protected. Attackers compromise passwords, keys, or authentication tokens to assume other users' identities.
web2py has a built-in mechanism for session management and uses a cookie to store the session id.

A8 - Insecure Cryptographic Storage Web applications rarely use cryptographic functions properly to protect data and credentials. Attackers use weakly protected data to conduct identity theft and other crimes, such as credit card fraud.
web2py, by default, uses the md5 algorithms to hash passwords. Other algorithms such as the HMAC are also available.

A9 - Insecure Communications Applications frequently fail to encrypt network traffic when it is necessary to protect sensitive communications.
web2py works with Apache and mod_ssl to provide strong encryption of communications.

A10 - Failure to Restrict URL Access Frequently, an application only protects sensitive functionality by preventing the display of links or URLs to unauthorized users. Attackers can use this weakness to access and perform unauthorized operations by accessing those URLs directly.
In web2py URLs are mapped into function calls. web2py provides a mechanism for declaring which functions are public and which require authentication/authorization.