aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/Security.md
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2015-07-22 05:02:10 +0200
committerVirtualTam <virtualtam@flibidi.net>2015-08-04 16:02:21 +0200
commit992af0b9d77cb4fbac2c37ef8d5896042d67a2a3 (patch)
tree4726baf18e7057eac3f9b6bdb5991fe6117814fc /doc/Security.md
parent96db105e4c0833324f7168edb5673278de8ccd54 (diff)
downloadShaarli-992af0b9d77cb4fbac2c37ef8d5896042d67a2a3.tar.gz
Shaarli-992af0b9d77cb4fbac2c37ef8d5896042d67a2a3.tar.zst
Shaarli-992af0b9d77cb4fbac2c37ef8d5896042d67a2a3.zip
Doc: sync from Wiki, generate HTML
Closes #291 Fixes #227 Modifications - HTML content: match the new Wiki structure - Makefile - generate a custom HTML sidebar - include the sidebar on all pages - infer and prepend page titles - handle relative links - add title metadata, e.g. Shaarli - <Page Name> Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'doc/Security.md')
-rw-r--r--doc/Security.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/Security.md b/doc/Security.md
new file mode 100644
index 00000000..7947460c
--- /dev/null
+++ b/doc/Security.md
@@ -0,0 +1,28 @@
1#Security
2## Client browser
3* Shaarli relies on `HTTP_REFERER` for some functions (like redirects and clicking on tags). If you have disabled or masqueraded `HTTP_REFERER` in your browser, some features of Shaarli may not work
4
5## PHP
6* `magic_quotes` is an horrible option of PHP which is often activated on servers. No serious developer should rely on this horror to secure their code against SQL injections. You should disable it (and Shaarli expects this option to be disabled). Nevertheless, I have added code to cope with `magic_quotes` on, so you should not be bothered even on crappy hosts.
7
8## Server and sessions
9* Directories are protected using `.htaccess` files
10* Forms are protected against XSRF (Cross-site requests forgery):
11 * Forms which act on data (save,deleteā€¦) contain a token generated by the server.
12 * Any posted form which does not contain a valid token is rejected.
13 * Any token can only be used once.
14 * Tokens are attached to the session and cannot be reused in another session.
15* Sessions automatically expire after 60 minutes.
16* Sessions are protected against hijacking: the session ID cannot be used from a different IP address.
17
18## Shaarli datastore and configuration
19* The password is salted, hashed and stored in the data subdirectory, in a PHP file, and protected by htaccess. Even if the webserver does not support htaccess, the hash is not readable by URL. Even if the .php file is stolen, the password cannot deduced from the hash. The salt prevents rainbow-tables attacks.
20* Links are stored as an associative array which is serialized, compressed (with deflate), base64-encoded and saved as a comment in a `.php` file.
21* Even if the server does not support `.htaccess` files, the data file will still not be readable by URL.
22* The database looks like this:
23```php
24<?php /* zP1ZjxxJtiYIvvevEPJ2lDOaLrZv7o...
25...ka7gaco/Z+TFXM2i7BlfMf8qxpaSSYfKlvqv/x8= */ ?>
26```
27
28* Small hashes are used to make a link to an entry in Shaarli. They are unique. In fact, the date of the items (eg. `20110923_150523`) is hashed with CRC32, then converted to base64 and some characters are replaced. They are always 6 characters longs and use only `A-Z a-z 0-9 - _` and `@`.