How to write secure applications with Eliom

Eliom and Ocsigen server automatically take charge of a lot of security issues. This unburdens the programmer from having to think about most common security problems. This page details various possible design flaws of Web applications, how Eliom and Ocsigen server (possibly) protects you against a possible exploitation of these flaws, and where you should be careful. Please help us maintaining this page, by sending us any comments.

HTTPS

If your Web site is using HTTP, all requests and responses may be intercepted. If you want your Web site to be secure, never send private data through HTTP:

The application only does client-side verification

This is probably the biggest (and most dangerous) possible mistake. As the user has an entire control over the data sent to the server, never assume that the data sent by the client has been verified (even if some validation happens in Js_of_ocaml). Instead, reimplement all verification server-side.

However, as we are using safe unmarshaling, incorrect data will never crash the server.

Example: Never trust the (current) user ID sent by the client process. Always take the userid from the session, through cookies.

Incorrect access controls

This typically happens if authentication is badly implemented, or altogether missing in some places.

Code injection

Path traversal

Session fixation

Cross-site scripting (XSS)

Cross site tracing

Redirection attacks

Header injection

On-site request forgery

Cross-site request forgery (XSRF)

Denial of service