Skip to content

feat(#134): file permissions and ONNX model checksum verification - #278

Merged
ajianaz merged 1 commit into
developfrom
fix/134-file-permissions-model-checksum
Jun 11, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/134-file-permissions-model-checksum

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Security improvements for file permissions and model integrity verification.

Changes

  1. Owner-only directory permissions (0700) on ~/.uteke/ database directories and model cache directories
  2. Owner-only file permissions (0600) on downloaded model files
  3. SHA256 checksum verification after each model file download from HuggingFace
  4. Pinned checksums for model_q4.onnx, model_q4.onnx_data, and tokenizer.json
  5. Auto-delete corrupted files with actionable error message on checksum mismatch
  6. Added sha2 dependency for checksum computation

Verification

  • cargo fmt ✅
  • cargo clippy -- -D warnings ✅
  • cargo test --workspace — 108/108 pass ✅

Closes #134

Security improvements:
- Set owner-only permissions (0700) on ~/.uteke/ database directories
- Set owner-only permissions (0700) on model cache directories
- Set owner-only permissions (0600) on downloaded model files
- Verify SHA256 checksum after each model file download
- Pin expected checksums for model_q4.onnx, model_q4.onnx_data,
  and tokenizer.json
- Delete corrupted files automatically with actionable error message
- Add sha2 dependency for checksum computation

Closes #134
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

⚠️ Review recommended — warnings found.

🟡 Warning (1)

  • unknown:? — Cora AI review could not complete: LLM API returned status 502:
<title>xixiapi.cc | 502: Bad gateway</title>

Bad gateway Error code 502

Visit cloudflare.com for more information.
2026-06-11 04:37:17 UTC
<span class="cf-icon-browser block md:hidden h-20 bg-center bg-no-repeat"></span>
<span class="cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span>
You

Browser

Working

Hong Kong

Cloudflare

Working

<span class="cf-icon-server block md:hidden h-20 bg-center bg-no-repeat"></span>
<span class="cf-icon-error w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span>
xixiapi.cc

Host

Error

    <div class="w-240 lg:w-full mx-auto mb-8 lg:px-8">
        <div class="clearfix">
            <div class="w-1/2 md:w-full float-left pr-6 md:pb-10 md:pr-0 leading-relaxed">
                <h2 class="text-3xl font-normal leading-1.3 mb-4">What happened?</h2>
                <p>The web server reported a bad gateway error.</p>
            </div>
            <div class="w-1/2 md:w-full float-left leading-relaxed">
                <h2 class="text-3xl font-normal leading-1.3 mb-4">What can I do?</h2>
                <p class="mb-6">Please try again in a few minutes.</p>
            </div>
        </div>
    </div>

    <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">
<p class="text-13">
  <span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">a09deaee1b7585ce</strong></span>
  <span class="cf-footer-separator sm:hidden">&bull;</span>
  <span id="cf-footer-item-ip" class="cf-footer-item hidden sm:block sm:mb-1">
    Your IP:
    <button type="button" id="cf-footer-ip-reveal" class="cf-footer-ip-reveal-btn">Click to reveal</button>
    <span class="hidden" id="cf-footer-ip">47.239.51.54</span>
    <span class="cf-footer-separator sm:hidden">&bull;</span>
  </span>
  <span class="cf-footer-item sm:block sm:mb-1"><span>Performance &amp; security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_502&#38;utm_campaign=xixiapi.cc" id="brand_link" target="_blank">Cloudflare</a></span>
  
</p>
<script>(function(){function d(){var b=a.getElementById("cf-footer-item-ip"),c=a.getElementById("cf-footer-ip-reveal");b&&"classList"in b&&(b.classList.remove("hidden"),c.addEventListener("click",function(){c.classList.add("hidden");a.getElementById("cf-footer-ip").classList.remove("hidden")}))}var a=document;document.addEventListener&&a.addEventListener("DOMContentLoaded",d)})();</script>
</div>
. Review was skipped; no code quality issues were found by the automated check.

Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit 151390f into develop Jun 11, 2026
9 checks passed
@ajianaz
ajianaz deleted the fix/134-file-permissions-model-checksum branch June 11, 2026 04:40
ajianaz added a commit that referenced this pull request Aug 13, 2026
Security improvements:
- Set owner-only permissions (0700) on ~/.uteke/ database directories
- Set owner-only permissions (0700) on model cache directories
- Set owner-only permissions (0600) on downloaded model files
- Verify SHA256 checksum after each model file download
- Pin expected checksums for model_q4.onnx, model_q4.onnx_data,
  and tokenizer.json
- Delete corrupted files automatically with actionable error message
- Add sha2 dependency for checksum computation

Closes #134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:core Core engine work type:security Security-related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔒 [P1] Set file permissions and add binary checksums to releases

1 participant