PerfectlySoft / PerfectlySoft/Perfect-Session
CSRF-TOKEN cookie may be sent with HttpOnly = true.
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 4
- Forks
- 14
- Avg merge
- 17m
- Merged PRs (30d)
- 1
Description
When the CSRF-TOKEN cookie is added to the response header, SessionConfig.cookieHTTPOnly is used to determine whether or not the cookie should be sent with the HTTPOnly attribute. However, for CSRF-TOKEN cookie to make sense it should always be sent without HTTPOnly so that JavaScript can copy its content to the X-CSRF-Token header when accessing APIs.
In the top-most comment of PerfectSession/WebSecurity/CSRF.swift this intention is actually documented. It is just the implementation that configures the cookie in an unexpected way.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in PerfectSession/WebSecurity/CSRF.swift and read its top-level comment alongside the code that creates the CSRF-TOKEN cookie. Trace how SessionConfig.cookieHTTPOnly affects that cookie; done means the CSRF cookie follows the documented JavaScript-accessible behavior regardless of the general session cookie setting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100