Populate valid versions from metadata, too #1850
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, WPScan populates its list of valid WordPress versions
from a list of fingerprinted WordPress files.
However, this file is not always up-to-date, causing version
detection to fail as WPScan thinks its not a valid version
and raises a InvalidWordPressVersion exception.
Since a lot of the version information is also pulled from
metadata.json anyway, also include this file for the initial
version detection, instead of just relying on the list of
fingerprinted files.
Fixes #1849
Discussion Question
I don't know why exactly the versions were pulled from the fingerprint files, anyway.
Maybe it makes sense to remove it completely?
Since I did not know, I went for the defensive approach and just determining the version based on both of them.
But I wonder why if there is a specific reason why it was not pulled from the metadata before, or why it was based on the fingerprints only.
Licensing
By submitting code contributions to the WPScan development team via Github Pull Requests, or any other method, it is understood that the contributor is offering the WPScan company (company number 83421476900012), which is registered in France, the unlimited, non-exclusive right to reuse, modify, and relicense the code.