Skip to content

Strengthen JWT algorithm-confusion regression coverage - #8514

Merged
makr-code merged 3 commits into
developfrom
copilot/sec-12-restore-jwt-security-tests
Dec 1, 2026
Merged

makr-code merged 3 commits into
developfrom
copilot/sec-12-restore-jwt-security-tests

Conversation

@makr-code

@makr-code makr-code commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Author: "ThemisDB Team"
Created: "2026-10-09"
Last Updated: "2026-11-19"
Status: "active"
AI_Used: true
AI_Models: "unknown"
AI_Contributor: "GitHub Copilot"
Human_Review: false
Human_Author: "ThemisDB Team"

Exact model backend not verifiable from final document text alone.

Pull Request

Target Version (Required)

Target Version: [Unreleased]

Security test coverage and audit traceability only; no production authentication behavior changes.


Description

SEC-12’s JWT test source and release-critical CTest registration were already present. This change strengthens the algorithm-confusion case with a valid HS256 token signed using the trusted RSA public modulus, and records the existing coverage and outstanding execution evidence in the audit roadmap.

  • Regression: alg=none, expiry, issuer, key rotation, and malformed tokens are covered; the HS256 case now verifies rejection of an actual confusion-style signature:
    alg=HS256; HMAC key = trusted RSA JWK modulus → reject
    
  • Traceability: /home/runner/work/ThemisDB/ThemisDB/audit/ROADMAP.md reflects the active test and CTest registration. SEC-12 remains in progress pending test-run evidence.

Linked Issues

Type of Change

Security regression-test hardening; documentation update. No production runtime or API changes.

Breaking Change Checklist

  • Plan the MAJOR version bump in VERSION and CMakeLists.txt.
  • Add a migration guide in docs/migration/.
  • Prepare the GitHub Discussions announcement (≥ 2 weeks before release).
  • Update the CHANGELOG ### Removed / ### Changed section.

Not applicable; no breaking change.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Benchmarks run (if performance-sensitive change)

The focused test was not run. CMake configuration stopped because fmt is unavailable; package installation was denied. GTest and nlohmann-json headers are also unavailable. No platform is claimed as passing.

  • Configure attempted: cmake -S /home/runner/work/ThemisDB/ThemisDB -B /tmp/themis-sec12-build -DTHEMIS_BUILD_TESTS=ON -DTHEMIS_DIAGNOSTIC_MODE=ON -DTHEMIS_ALLOW_MISSING_ROCKSDB=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=
  • Intended target/test: module_security_test_jwt_security_focused / test_jwt_security_SecurityFocusedTests

Security Tiering Impact (for Runtime Changes)

  • Impacted tier(s): N/A (test-only / no runtime change)

No runtime trust-boundary or control behavior changed.

📚 Research & Knowledge (wenn applicable)

Based on scientific papers or best practices? No.

Relevante Quellen:

  • Paper:
  • Best Practice:
  • Architecture Decision:

AI-Generated Code (KI-generierter Code)

  • Symbol-Referenzen mit GetSymbolReferences_CppTools geprüft (siehe .github/instructions/cpp-language-service-tools.instructions.md)
  • Keine rohen Pointer und kein new/delete ohne explizites Review eingeführt
  • RAII und Exception-Safety für neue/angepasste Pfade geprüft
  • Keine unnötig komplexen KI-Abstraktionen eingeführt
  • Performance-Metriken geprüft, falls Hotpath betroffen

AI Review Workflow (Required for AI-assisted PRs)

  • Findings-first review performed with .github/prompts/pr-diff-findings-review.prompt.md
  • Security hardening review performed for security-sensitive/runtime changes with .github/prompts/security-hardening-review.prompt.md (or N/A documented)
  • API impact review performed for API/contract changes with .github/prompts/api-change-impact-review.prompt.md (or N/A documented)
  • All Critical/High findings are resolved or explicitly accepted with rationale in PR description
  • Residual risks and follow-up actions documented in PR description
  • Severity policy applied according to .github/copilot/REVIEW_SEVERITY_POLICY.md

High-Finding Exception Record (only if High is accepted)

  • High-finding exception claimed in this PR

  • Finding reference:

  • Maintainer approver:

  • Mitigation in current release:

  • Target fix milestone:

  • Tracking issue:

  • Validation evidence:

Release Readiness Gate (Required for release-scoped changes)

Not a release-scoped change.

  • Review release readiness with .github/prompts/release-readiness-check.prompt.md for branch transition scope.
  • Validate branch governance against BRANCHING_STRATEGY.md and RELEASE_STRATEGY.md.
  • Validate versioning/changelog impact against VERSIONING.md and CHANGELOG.md.

Checklist

  • Code follows project style guidelines (clang-format / clang-tidy)
  • Self-review completed
  • Documentation updated (if needed)
  • Update CHANGELOG.md under [Unreleased]
  • No new warnings introduced
  • Security-sensitive paths reviewed by security maintainer (if applicable)

Scanner and IntelliSense Gates

  • IntelliSense/Compiler: no new errors in changed files
  • clang-tidy/cppcheck: no new high-risk findings in changed files
  • Gap Scanner: no new critical findings in categories security, input_validation, query_correctness, distributed_consistency, concurrency, memory
  • Gap Scanner: no new high findings in the same categories (or explicitly approved)
  • Gap Scanner delta report attached (baseline vs current), not only absolute totals
  • New unknown scanner findings triaged (fixed, re-categorized, or justified)

Secret scan found no secrets. CodeQL reported zero alerts but skipped C++ analysis because the database was too large.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

Copilot AI linked an issue Dec 1, 2026 that may be closed by this pull request
8 tasks
@makr-code makr-code changed the title [WIP] Restore JWT security tests Strengthen JWT algorithm-confusion regression coverage Dec 1, 2026
@makr-code
makr-code marked this pull request as ready for review December 1, 2026 15:27
@makr-code
makr-code merged commit 834b8c1 into develop Dec 1, 2026
25 of 27 checks passed
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

RAG Security Guardrails Gate Report

Date: 2026-12-01T15:41:52Z
PR: 8514
Commit: 1158ffe
Validation job result: success

Validation outcomes are recorded by the individual workflow steps and in the run summary.

References

  • Spec: src/security/RETRIEVAL_POLICY_ENFORCEMENT.md
  • Module: src/security, src/retrieval

@github-actions github-actions Bot added the status/resolved Finding resolved and verified by automation label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Target: pr

Doc Metadata Gate


source_workflow: Gate: PR Doc Metadata
source_run: 46679463384
source_sha: 2bb08d0

@github-actions github-actions Bot added the release_critical Change in a release-critical module; requires sign-off label Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

quality/security rag-security-required release_critical Change in a release-critical module; requires sign-off status/resolved Finding resolved and verified by automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SEC-12] Restore JWT security tests

3 participants