Skip to content

Conversation

HappyStoic
Copy link

@HappyStoic HappyStoic commented Jul 27, 2025

Until now, matchKeyValueString and matchMapString iterated over fingerprint patterns in non deterministic order because some parsed fingerprint patterns (for example headers) are parsed into a map type. Since also these functions iterated over patterns until a first match, it could return different version upon each run (described in issue #138).

With this change:

  • There is a deterministic behavior because always all patterns are checked.
  • There isn't a right way to choose a final version from a list of discovered versions IMO. I decided to use the lowest found because I think that one in theory poses the biggest security risk.
  • From a list of found confidences, I choose a maximum value because from my understanding of the rest of the code any non-zero confidence value automatically flags the discovery as valid anyway.

* This ensures deterministic behaviour because until now patterns were iterated in random order (they are parsed into a map)
* This ensures always the lowest found version is returned. Lowest because it in theory represents the biggest risk
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