Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pleroma pleroma
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 646
    • Issues 646
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 88
    • Merge requests 88
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PleromaPleroma
  • pleromapleroma
  • Merge requests
  • !446

Add __Host- prefix when secure flag is enabled

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged shibayashi requested to merge shibayashi/pleroma:security/cookie-hardening into develop Nov 12, 2018
  • Overview 4
  • Commits 1
  • Pipelines 1
  • Changes 1

This sets the __Host- prefix to the Pleroma session cookie. A browser will only accept a cookie with this prefix if it fulfills the following requirements:

  • Secure attributes needs to be set
  • URI scheme must be considered secure by browser
  • Set-Cookie does not contain a Domain attribute. The cookie is only sent to the host which sets it.
  • Path needs to be set to /. The cookie is sent at every request.

Browsers with no support (IE and Edge) will just ignore the prefix and treat it as part of the name.

Example scenario

A user visits the website for the first time over HTTP and an attacker intercepts the connection and plants a session cookie. Pleroma now thinks, that the user already has the cookie and uses the attacker controlled session. The __Host- prefix prevents this attack, because the session cookie can now only be set over a secure connection.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: security/cookie-hardening