Skip to content

Restrict unsealed output file permissions - #603

Merged
dgarske merged 1 commit into
wolfSSL:masterfrom
aidangarske:codeql-46-unseal-permissions
Sep 10, 2026
Merged

Restrict unsealed output file permissions#603
dgarske merged 1 commit into
wolfSSL:masterfrom
aidangarske:codeql-46-unseal-permissions

Conversation

@aidangarske

Copy link
Copy Markdown
Member

@aidangarske aidangarske self-assigned this Sep 10, 2026
Copilot AI lite review requested due to automatic review settings September 10, 2026 17:36
@aidangarske
aidangarske requested a review from dgarske September 10, 2026 17:36
dgarske
dgarske previously approved these changes Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 0600 and 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.

Comment thread examples/seal/unseal.c Outdated
Comment thread examples/seal/unseal.c Outdated
Comment thread examples/seal/unseal.c
Comment thread examples/seal/unseal.c Outdated
@dgarske
dgarske merged commit 4ff1972 into wolfSSL:master Sep 10, 2026
218 checks passed
@aidangarske
aidangarske deleted the codeql-46-unseal-permissions branch September 10, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants