Skip to content

Avoid CodeQL warning by flipping logic around tenant config lookup #3968

@lmsurpre

Description

@lmsurpre

Currently, when a request comes in with an X-FHIR-TENANT-ID header value, we:

  1. validate the value to ensure it doesn't contain unexpected characters (e.g. / or .); then
  2. lookup the tenant configuration for the passed tenantId (filesystem read)

Despite the input validation, CodeQL is flagging that as a potential vulnerability.

We think we can make that warning go away by flipping our processing.

  1. read all the tenant config directory names during startup and store them in a map
  2. when a request comes in for a particular tenant, look it up in the map (vs looking for a directory of that name from filesystem)

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions