Skip to content

harden: remove hardcoded secret in index.js... - #355

Open
anupamme wants to merge 2017 commits into
mapcentia:developfrom
anupamme:fix-repo-vidi-express-session-hardcoded-secret
Open

harden: remove hardcoded secret in index.js...#355
anupamme wants to merge 2017 commits into
mapcentia:developfrom
anupamme:fix-repo-vidi-express-session-hardcoded-secret

Conversation

@anupamme

Copy link
Copy Markdown

Summary

Harden input handling in index.js (flagged by semgrep).

Vulnerability

Field Value
ID javascript.express.security.audit.express-session-hardcoded-secret.express-session-hardcoded-secret
Severity HIGH
Scanner semgrep
Rule javascript.express.security.audit.express-session-hardcoded-secret.express-session-hardcoded-secret
File index.js:91
Assessment Defensive hardening

Description: A hard-coded credential was detected. It is not recommended to store credentials in source-code, as this risks secrets being leaked and used by either an internal or external malicious adversary. It is recommended to use environment variables to securely provide credentials or retrieve credentials from a secure vault or HSM (Hardware Security Module).

Threat Model Context

This is a web service - vulnerabilities in request handlers are directly exploitable by remote attackers.

Changes

  • index.js

Behavior Preservation

The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.


This patch removes an exploit primitive — a code pattern that, while not independently exploitable today, could be chained with other weaknesses by automated exploit-development tooling. Proactive removal of such primitives raises the bar against increasingly capable automated attack tools.


Automated security fix by OrbisAI Security

# Conflicts:
#	browser/modules/sqlQuery.js
#	package-lock.json
#	package.json
…clude minimal JWT decoding and streamlined persistence handling. Update session backend to support superuser parameter.
… SQL queries. Introduce `quoteRelation` utility for safe formatting.
…mples, including buffer setup, metadata usage, and SQL analysis.
mapcentia and others added 29 commits May 29, 2026 13:30
Prevent redundant '?' when appending query parameters to WMTS URL.
…c error handling

Integrate `express-async-errors` to forward async route rejections to a central error handler. Implement a middleware-based error handler for consistent error responses.
…ling

Switch from `request` to modern `fetch` API, leveraging `express-async-errors` for centralized async error handling. Streamline error checks and parsing logic for improved readability.
…andling

Replace deprecated `request` library with modern `fetch` across controllers. Simplify async handling and response/error processing for improved readability and code consistency. Update copyright to 2026.
…downloads

Ensure `whereClause` defaults to '1=1' when no filters are active. Add versioning check to filter out ended versions in downloads.
…ew option selection and modularize click event handling
…et.express-session-hardcoded-secret security vulnerability

Automated security fix generated by OrbisAI Security
@giovanniborella

giovanniborella commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@mapcentia: Relevant commit: eb5c10f

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.

3 participants