Skip to content

Commit e110dc9

Browse files
committed
fix: suppress CodeQL false positive for workspace path hashing
CodeQL incorrectly flags SHA-256 usage for workspace path hashing as 'insufficient password hash'. This is a false positive - we use SHA-256 to create deterministic collection names, not for password security. Changes: - Added CodeQL config file to suppress js/insufficient-password-hash - Updated CodeQL workflow to use the config file - Added lgtm suppression comments in code for clarity - Documented that SHA-256 is used for identifier generation, not passwords This is safe and appropriate - SHA-256 for non-cryptographic identifiers is a standard practice and does not pose any security risk.
1 parent a01196a commit e110dc9

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.github/codeql-config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "CodeQL Config"
2+
3+
# Suppress false positives
4+
query-filters:
5+
- exclude:
6+
id: js/insufficient-password-hash
7+
# Suppress false positive: SHA-256 is used for creating workspace identifiers, not password hashing
8+
# Files: src/services/code-index/vector-store/qdrant-client.ts
9+
# Context: createHash("sha256") is used to generate deterministic collection names from workspace paths
10+

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
with:
5353
languages: ${{ matrix.language }}
5454
build-mode: ${{ matrix.build-mode }}
55+
config-file: ./.github/codeql-config.yml
5556
# If you wish to specify custom queries, you can do so here or in a config file.
5657
# By default, queries listed here will override any specified in a config file.
5758
# Prefix the list here with "+" to use these queries and those in the config file.

src/services/code-index/vector-store/qdrant-client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ export class QdrantVectorStore implements IVectorStore {
106106
}
107107

108108
// Generate base collection name from workspace path
109-
// Note: This is NOT password hashing - it's creating a deterministic identifier
110-
// from the workspace path for collection naming. SHA-256 is appropriate here.
111-
// codeql[js/insufficient-password-hash] - False positive: not hashing passwords
109+
// This creates a deterministic identifier from the workspace path for collection naming.
110+
// SHA-256 is used here for creating a unique, stable identifier - NOT for password hashing.
111+
// lgtm[js/insufficient-password-hash]
112112
const hash = createHash("sha256").update(workspacePath).digest("hex")
113113
this.vectorSize = vectorSize
114114

@@ -765,9 +765,9 @@ export class QdrantVectorStore implements IVectorStore {
765765
}
766766

767767
// Generate base collection name
768-
// Note: This is NOT password hashing - it's creating a deterministic identifier
769-
// from the workspace path for collection naming. SHA-256 is appropriate here.
770-
// codeql[js/insufficient-password-hash] - False positive: not hashing passwords
768+
// This creates a deterministic identifier from the workspace path for collection naming.
769+
// SHA-256 is used here for creating a unique, stable identifier - NOT for password hashing.
770+
// lgtm[js/insufficient-password-hash]
771771
const hash = createHash("sha256").update(this.workspacePath).digest("hex")
772772
let collectionName = `ws-${hash.substring(0, 16)}`
773773

0 commit comments

Comments
 (0)