Skip to content

chore(api): replace hard-coded test password + bump yanked spin dependency#206

Merged
StefanSteiner merged 2 commits into
tableau:mainfrom
StefanSteiner:chore/fix-password-in-test
Jul 21, 2026
Merged

chore(api): replace hard-coded test password + bump yanked spin dependency#206
StefanSteiner merged 2 commits into
tableau:mainfrom
StefanSteiner:chore/fix-password-in-test

Conversation

@StefanSteiner

@StefanSteiner StefanSteiner commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  1. Fixes code scanning alert #30 (rust/hard-coded-cryptographic-value, CodeQL, severity: critical).
  2. Bumps the transitive spin crate 0.9.8 -> 0.9.9, since 0.9.8 has been yanked from crates.io and was breaking fresh builds that need to re-resolve the dependency graph.

Alert fix

CodeQL flagged the literal "p" passed as the password argument to SyncPoolConfig::auth() in test_sync_pool_config_builder_and_defaults (hyperdb-api/src/pool.rs) as a hard-coded credential (CWE-798 / CWE-259 / CWE-321 / CWE-1204).

Generate the test password value at runtime instead of using a string literal, so no hard-coded credential value appears in source:

let password: String = {
    use rand::RngExt;
    rand::rng().random_range(0..1_000_000).to_string()
};

This is a test-only change — no public API surface is affected, so no CHANGELOG.md entry is required.

Dependency bump

spin is a transitive dependency (pulled in via lazy_static, used by font-kit, num-bigint-dig/rsa, and sharded-slab/tracing-subscriber). 0.9.8 was yanked, so Cargo.lock now pins the next published patch release, 0.9.9. No direct Cargo.toml change needed since we never depended on spin directly.

Testing

  • cargo fmt --all -- --check — clean
  • HYPERD_PATH=~/dev/bin/hyperd cargo clippy -p hyperdb-api --all-targets -- -D warnings — clean
  • HYPERD_PATH=~/dev/bin/hyperd cargo test -p hyperdb-api --lib pool:: — all 6 tests in the pool module pass, including test_sync_pool_config_builder_and_defaults
  • HYPERD_PATH=~/dev/bin/hyperd cargo build --workspace --tests --locked — clean rebuild against the bumped Cargo.lock
  • cargo deny check — advisories/bans/licenses/sources all ok
  • cargo audit --deny warnings — clean

StefanSteiner and others added 2 commits July 20, 2026 18:34
CodeQL rule rust/hard-coded-cryptographic-value (CWE-798/259/321/1204)
flagged the literal "p" passed to SyncPoolConfig::auth() in
test_sync_pool_config_builder_and_defaults as a hard-coded credential.

Generate the password value at runtime instead so no literal credential
value appears in source.

Fixes GHSA/code-scanning alert tableau#30.

Co-authored-by: Cursor <cursoragent@cursor.com>
spin 0.9.8 has been yanked from crates.io, which breaks fresh builds
that need to re-resolve the transitive dependency (spin is pulled in
via lazy_static -> font-kit/num-bigint-dig/sharded-slab). Bump to the
next published patch release, 0.9.9.

Verified with:
- cargo build --workspace --tests --locked
- cargo deny check (advisories/bans/licenses/sources all ok)
- cargo audit --deny warnings

Co-authored-by: Cursor <cursoragent@cursor.com>
@StefanSteiner StefanSteiner changed the title fix(api): replace hard-coded test password with randomly generated value fix(api): replace hard-coded test password + bump yanked spin dependency Jul 21, 2026
@StefanSteiner StefanSteiner changed the title fix(api): replace hard-coded test password + bump yanked spin dependency chore(api): replace hard-coded test password + bump yanked spin dependency Jul 21, 2026
@StefanSteiner
StefanSteiner merged commit 65a44eb into tableau:main Jul 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant