Cookie dan sesi untuk Apache HTTP Server
high5 titik pemeriksaan
Cookie sesi adalah kunci akun. Atribut yang hilang mengubah satu celah XSS menjadi pengambilalihan akun penuh.
Yang harus ada di Apache HTTP Server
- Atribut Secure pada setiap cookie
- HttpOnly pada cookie sesi
- SameSite=Lax atau Strict pada cookie sesi
- Tidak ada ID sesi di URL atau localStorage
- Rotasi sesi setelah login dan invalidasi saat logout
Cara memperbaiki
- 1Set atribut cookie di level framework agar semua cookie mewarisinya
- 2Pindahkan token dari localStorage ke cookie HttpOnly
Konteks Apache HTTP Server
Long-standing web server and reverse proxy with a module ecosystem.
Disable autoindex, restrict /server-status, and keep mod_proxy/mod_cgi patched (CVE-2024-38476).