Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(security): clear prerelease-docker.yml scan alerts (#7774, #7775, #7776) (#4223)

LearningCircuitfb4755f94dfd
diff --git a/.github/SECURITY_ALERTS.md b/.github/SECURITY_ALERTS.md
index 1a0997568d..45f9ce31a8 100644
--- a/.github/SECURITY_ALERTS.md
+++ b/.github/SECURITY_ALERTS.md
@@ -111,6 +111,42 @@ to track technical debt and future work.
---
+## DS126858 - Weak/Broken Hash Algorithm
+
+**Status:** Excluded in DevSkim workflow via `exclude-rules`
+
+### Explanation
+
+DevSkim flags any literal occurrence of `sha1` as a "weak/broken hash
+algorithm". In this codebase the only matches are:
+
+1. **SLSA provenance JSON keys** in `.github/workflows/prerelease-docker.yml` —
+ the `"sha1"` key inside `digest` objects is part of the
+ [SLSA in-toto provenance schema](https://slsa.dev/spec/v0.2/provenance) and
+ identifies the algorithm Git itself uses for commit hashes. We are not
+ choosing SHA-1 as a cryptographic primitive — Git's commit identifier
+ format is fixed.
+
+2. **SQLCipher KDF/HMAC algorithm enums** in
+ `src/local_deep_research/settings/env_definitions/db_config.py`
+ (`PBKDF2_HMAC_SHA1`, `HMAC_SHA1`). These exist for backwards-compatibility
+ with existing user databases; the default is SHA-512. Each occurrence
+ carries an inline `# DevSkim: ignore DS126858` annotation with rationale.
+
+### Why Exclusion Is Safe
+
+1. **Not a cryptographic choice** - The `sha1` strings in SLSA provenance are
+ *protocol-mandated key names*, not crypto operations we control.
+2. **Git's commit hashing is SHA-1 by design** - The Linux kernel and every
+ git-backed project produces SHA-1 commit IDs; SLSA records them honestly.
+3. **Real SHA-1 misuse would be reviewed** - The SQLCipher backwards-compat
+ uses are documented and reviewed; new uses of SHA-1 as a cryptographic
+ primitive would be caught in code review and by CodeQL.
+4. **No password/signature SHA-1 in this codebase** - Authentication uses
+ `secrets`/Argon2-class KDFs and SQLCipher's SHA-512 default.
+
+---
+
## Container Image CVEs
**Status:** Documented, awaiting upstream fixes
@@ -138,6 +174,10 @@ The following rules are excluded in `.github/workflows/devskim.yml`:
|------|------|--------|
| DS162092 | Hardcoded URL | Legitimate API endpoints for research services |
| DS176209 | Suspicious Comment | Standard TODO/FIXME annotations |
+| DS137138 | Hardcoded Credentials | All matches are test fixtures (mock data) |
+| DS148264 | Use cryptographic random | All `random` usages are non-security (ML shuffle, jitter) |
+| DS172411 | setTimeout code injection | All setTimeout calls pass function refs, never strings |
+| DS126858 | Weak/Broken Hash Algorithm | SLSA-schema-required `sha1` JSON key + SQLCipher backwards-compat enums |
### Review Cadence
@@ -146,7 +186,7 @@ These exclusions should be reviewed **quarterly** to ensure:
- Exclusions remain appropriate as the codebase evolves
- New DevSkim rules are evaluated for applicability
-**Last reviewed:** December 2025
+**Last reviewed:** May 2026
---
diff --git a/.github/workflows/devskim.yml b/.github/workflows/devskim.yml
index 372472c359..4fc8379bc9 100644
--- a/.github/workflows/devskim.yml
+++ b/.github/workflows/devskim.yml
@@ -77,7 +77,18 @@ jobs:
# setTimeout(() => {...}, delay) or setTimeout(functionName, delay).
# No string-based setTimeout usage exists.
#
- exclude-rules: 'DS176209,DS162092,DS137138,DS148264,DS172411'
+ # DS126858 - "Weak/Broken Hash Algorithm"
+ # Flags any occurrence of the literal string "sha1". In this codebase
+ # the only matches are the JSON key name `"sha1"` inside SLSA provenance
+ # attestations (.github/workflows/prerelease-docker.yml) — that key name
+ # is *required* by the SLSA in-toto schema for git-commit digests, and
+ # Git itself uses SHA-1 for commit identifiers. It is not a cryptographic
+ # choice we make. Legitimate SHA-1 references elsewhere (PBKDF2_HMAC_SHA1,
+ # HMAC_SHA1 in db_config.py for SQLCipher backwards compatibility) carry
+ # their own inline `# DevSkim: ignore DS126858` annotations explaining the
+ # rationale. See .github/SECURITY_ALERTS.md for the full assessment.
+ #
+ exclude-rules: 'DS176209,DS162092,DS137138,DS148264,DS172411,DS126858'
- name: Upload DevSkim results to GitHub Security
uses: github/codeql-action/upload-sarif@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
diff --git a/.github/workflows/prerelease-docker.yml b/.github/workflows/prerelease-docker.yml
index 0c648ed993..03453ea2a3 100644
--- a/.github/workflows/prerelease-docker.yml
+++ b/.github/workflows/prerelease-docker.yml
@@ -343,23 +343,32 @@ jobs:
#
# buildInvocationId includes run_attempt so re-runs are
# distinguishable in audit logs.
+ #
+ # Uses auto-injected GITHUB_* shell env vars (GITHUB_REPOSITORY,
+ # GITHUB_REF, GITHUB_SHA, GITHUB_RUN_ID, GITHUB_RUN_ATTEMPT) instead
+ # of github-context template expansion to satisfy zizmor's
+ # template-injection check. The values are semantically identical
+ # inside a workflow_call callee (both scope to the caller's context),
+ # but shell-var expansion happens at runtime in a confined string
+ # context, eliminating any theoretical injection surface from a
+ # ref/branch name containing shell metacharacters.
cat > provenance.json <<EOF
{
- "buildType": "https://github.com/${{ github.repository }}/docker-build@v1",
+ "buildType": "https://github.com/${GITHUB_REPOSITORY}/docker-build@v1",
"builder": {
- "id": "https://github.com/${{ github.repository }}/.github/workflows/prerelease-docker.yml@${{ github.ref }}"
+ "id": "https://github.com/${GITHUB_REPOSITORY}/.github/workflows/prerelease-docker.yml@${GITHUB_REF}"
},
"invocation": {
"configSource": {
- "uri": "https://github.com/${{ github.repository }}",
+ "uri": "https://github.com/${GITHUB_REPOSITORY}",
"digest": {
- "sha1": "${{ github.sha }}"
+ "sha1": "${GITHUB_SHA}"
},
"entryPoint": ".github/workflows/release.yml"
}
},
"metadata": {
- "buildInvocationId": "${{ github.run_id }}-${{ github.run_attempt }}",
+ "buildInvocationId": "${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}",
"buildStartedOn": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"completeness": {
"parameters": false,
@@ -370,9 +379,9 @@ jobs:
},
"materials": [
{
- "uri": "https://github.com/${{ github.repository }}",
+ "uri": "https://github.com/${GITHUB_REPOSITORY}",
"digest": {
- "sha1": "${{ github.sha }}"
+ "sha1": "${GITHUB_SHA}"
}
}
]
@@ -397,8 +406,11 @@ jobs:
RETRY_DELAY=10
for i in $(seq 1 "$MAX_RETRIES"); do
echo "Verification attempt $i of $MAX_RETRIES..."
+ # Use GITHUB_REPOSITORY shell env var (auto-injected) instead of
+ # github.repository template expansion to avoid zizmor's
+ # template-injection finding.
if cosign verify \
- --certificate-identity-regexp="https://github.com/${{ github.repository }}" \
+ --certificate-identity-regexp="https://github.com/${GITHUB_REPOSITORY}" \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
"$IMAGE_REF"; then
echo "Signature verification successful!"