Create the persisted session cache file with owner-only permissions - #11291
Conversation
|
Can one of the admins verify this patch? |
34eb599 to
b736db5
Compare
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR tightens permissions for persisted session cache files on POSIX builds by opening the cache file with owner-only permissions, and documents the security implications of writing session secrets to disk.
Changes:
- Added a POSIX-specific
SaveSessionCacheOpen()helper that usesopen(…, 0600)+fchmod()+fdopen(). - Switched
wolfSSL_save_session_cache()to useSaveSessionCacheOpen()instead ofXFOPEN(). - Added Doxygen warning about plaintext secrets and platform-specific file permissions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ssl_sess.c | Adds POSIX open+chmod path to ensure the cache file is owner-only (0600). |
| doc/dox_comments/header_files/ssl.h | Documents plaintext secret risk and notes 0600 behavior on POSIX. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
retest this please |
b736db5 to
d028a34
Compare
|
Jenkins retest this please (lost logs) |
|
Jenkins retest this please |
1 similar comment
|
Jenkins retest this please |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11291
Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
philljj
left a comment
There was a problem hiding this comment.
I think this looks good.
I would just suggest to use the wc_open_cloexec wrapper, and see if the fchmod can be refactored to a new or existing wrapper in wc_port.c
d028a34 to
a086566
Compare
|
Jenkins retest this please (timeout) |
a086566 to
c8cc22c
Compare
|
Jenkins retest this please (lost logs) |
|
Jenkins retest this please (timeout) |
1 similar comment
|
Jenkins retest this please (timeout) |
|
Jenkins retest this please (timeout) |
Description
On POSIX builds wolfssl_save_session_cache now opens the file with open in 0600 mode + fdopen.
Checklist