Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

fix(validators): stop the version-label regex stalling the PII scan on long identifiers (#684)

Christopher Kevinb72805b44c76
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bcb65dfe..84b97103 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -411,6 +411,8 @@ All notable changes to SkillEvaluator are documented in this file.
### Fixed
+- The Tier 1 PII scan no longer stalls on a long identifier before an IPv4-shaped value. A line with a
+ 30-letter name followed by `= "8.8.0.8"` took about a minute to scan, and every further letter doubled that.
- Keep Steps per Eval Case chart labels readable for long case IDs while preserving full IDs in hover tooltips.
- Negative controls with complete, confirmed skill non-use report wrong answers as task outcomes instead of recommending skill edits; truncated or recovered attempt evidence cannot establish complete non-use.
- Repeated negative-case task outcomes share one advice item, retain task-failure wording and avoid describing passing attempts as lost, keeping distinct skill fixes visible.
diff --git a/src/skillevaluator/validators/security.py b/src/skillevaluator/validators/security.py
index 0ab86919..feebf9b1 100644
--- a/src/skillevaluator/validators/security.py
+++ b/src/skillevaluator/validators/security.py
@@ -6110,13 +6110,17 @@ class SecurityValidator(ValidatorBase):
)
# Match version/tag as identifier tokens, including separator and camel-case styles.
# Plain substrings such as ``conversion`` and ``staging`` are not version labels.
+ # The camel-case words around the label are written as one run each
+ # (``[A-Z][A-Za-z0-9]*``), not as a repeated word group: a repeated group can
+ # split a run of letters in exponentially many ways, and a long identifier
+ # before an IPv4-shaped value then stalls the scan.
_VERSION_LABEL_PATTERN = re.compile(
r"(?:"
r"(?i:(?<![a-z0-9])(?:[a-z0-9]+[_-])*(?:versions?|tags?)(?:[_-][a-z0-9]+)*(?![a-z0-9]))"
- r"|(?<![A-Za-z0-9])(?:[A-Za-z][a-z0-9]*)*(?:Version|Versions|Tag|Tags)"
- r"(?:[A-Z][A-Za-z0-9]*)*(?![A-Za-z0-9])"
+ r"|(?<![A-Za-z0-9])(?:[A-Za-z][A-Za-z0-9]*)?(?:Version|Versions|Tag|Tags)"
+ r"(?:[A-Z][A-Za-z0-9]*)?(?![A-Za-z0-9])"
r"|(?<![A-Za-z0-9])(?:version|versions|tag|tags)"
- r"(?:[A-Z][A-Za-z0-9]*)+(?![A-Za-z0-9])"
+ r"[A-Z][A-Za-z0-9]*(?![A-Za-z0-9])"
r")"
)
_PACKAGE_VERSION_CALL_PATTERN = re.compile(
diff --git a/tests/validators/test_security.py b/tests/validators/test_security.py
index 9808aad7..4b7a7a34 100644
--- a/tests/validators/test_security.py
+++ b/tests/validators/test_security.py
@@ -8613,6 +8613,40 @@ class TestSpdxAndIpFalsePositiveHardening:
assert not any(finding.check_name == "ip_addresses" for finding in result.findings)
+ def test_long_identifiers_before_ip_values_do_not_stall_the_scan(self, tmp_path: Path) -> None:
+ """Regression (CWE-1333): the version-label pattern could split a run of letters in exponentially many
+ ways, so a 30-letter identifier before an IPv4-shaped value stalled the PII scan for about a minute and
+ every further letter doubled that. Runs in a subprocess so that a slow scan fails the timeout instead of
+ hanging the suite; the limit is generous because the scan takes about a second."""
+ skill_dir = tmp_path / "long-identifier-skill"
+ skill_dir.mkdir()
+ not_labels = ["a" * 76, "A" * 76, "aB" * 38, "a1" * 38]
+ labels = ["a" * 69 + "Version", "version" + "A" * 69, "Tag" + "Ab1" * 24, "a" * 60 + "_version"]
+ (skill_dir / "SKILL.md").write_text(
+ "".join(f'{name} = "8.8.0.{index}"\n' for index, name in enumerate(not_labels, 1))
+ + "".join(f'{name} = "4.4.0.{index}"\n' for index, name in enumerate(labels, 1)),
+ encoding="utf-8",
+ )
+ # Keep the child on this checkout even if its interpreter has another editable install.
+ code = (
+ "import json, sys\n"
+ f"sys.path.insert(0, {str(Path(__file__).resolve().parents[2] / 'src')!r})\n"
+ "from pathlib import Path\n"
+ "from skillevaluator.validators.security import SecurityValidator\n"
+ "result = SecurityValidator().validate_pii_only(Path(sys.argv[1]))\n"
+ "found = {f.metadata.get('matched_value') for f in result.findings if f.check_name == 'ip_addresses'}\n"
+ "print(json.dumps(sorted(found)))\n"
+ )
+
+ completed = subprocess.run(
+ [sys.executable, "-c", code, str(skill_dir)], capture_output=True, text=True, timeout=60
+ )
+
+ assert completed.returncode == 0, completed.stderr
+ # The long plain identifiers are not version labels, so their values are still reported;
+ # the long labels still mark theirs as release versions.
+ assert json.loads(completed.stdout) == ["8.8.0.1", "8.8.0.2", "8.8.0.3", "8.8.0.4"]
+
@pytest.mark.parametrize(
"line",
[