Restrict unsealed output file permissions - #603
Merged
Conversation
dgarske
previously approved these changes
Sep 10, 2026
There was a problem hiding this comment.
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.
Pull request overview
This PR addresses a code-scanning finding by ensuring unsealed output files are created with owner-only permissions, and adds a regression check to verify the behavior even under a permissive umask.
Changes:
- Add a POSIX-specific helper to create/truncate unseal output files with mode
0600and tighten permissions for pre-existing files. - Update the unseal example to use that helper instead of
XFOPEN. - Extend the examples runner to validate the unseal output contents and file mode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| examples/seal/unseal.c | Introduces secure(ish) POSIX file creation for unseal output and switches the example to use it. |
| examples/run_examples.sh | Adds a regression check to ensure unseal output remains 600 even with umask 000, and validates output content. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
aidangarske
force-pushed
the
codeql-46-unseal-permissions
branch
from
September 10, 2026 19:57
2dcbfc8 to
863f0f9
Compare
dgarske
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/wolfSSL/wolfTPM/security/code-scanning/46