diff --git a/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll b/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll index 2be71612f26..3f65a2ffc72 100644 --- a/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll +++ b/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll @@ -6,6 +6,11 @@ class UnversionedImmutableAction extends UsesStep { UnversionedImmutableAction() { immutableActionsDataModel(immutable_action) and this.getCallee() = immutable_action and - not this.getVersion().regexpMatch("^(v)?[0-9]+(\\.[0-9]+)*(\\.[xX])?$") + isNotSemVer(this.getVersion()) } } + +bindingset[version] +predicate isNotSemVer(string version) { + not version.regexpMatch("^(v)?[0-9]+(\\.[0-9]+)*(\\.[xX])?$") +}