Skip to content

fix(security): T2.x.2 hardening: drop test-scope javafaker (fully removes snakeyaml 1.x) (issue #100) - #101

Open
natechadwick-intsof wants to merge 1 commit into
mainfrom
security/t2-x-2-snakeyaml-test-cleanup
Open

fix(security): T2.x.2 hardening: drop test-scope javafaker (fully removes snakeyaml 1.x) (issue #100)#101
natechadwick-intsof wants to merge 1 commit into
mainfrom
security/t2-x-2-snakeyaml-test-cleanup

Conversation

@natechadwick-intsof

Copy link
Copy Markdown
Collaborator

Summary

PR #99 removed javafaker from production code, but two test files still declared javafaker at <scope>test</scope> in their own poms, keeping org.yaml:snakeyaml:1.23-android reachable on the test classpath. This slice removes those final javafaker usages, so the project dep graph has no snakeyaml:1.x left at any scope.

Changes

File Change
projects/sitemanage/.../PSDefaultPasswordEncryptionBeanTest.java Faker.aquaTeenHungerForce().character()UUID.randomUUID()
deliverytiersuite/delivery-tier-suite/metadata/.../PSMetadataQueryServiceTest.java Faker.chuckNorris().fact() / Faker.hitchhikersGuideToTheGalaxy().quote() / Faker.animal().name() (×4) → per-entry deterministic strings ("linktext-{idx}", "abstract-{idx}", "cat-{idx}-a/b/c/d")
projects/sitemanage/pom.xml Removed com.github.javafaker:javafaker:1.0.2 (test-scope)
deliverytiersuite/delivery-tier-suite/metadata/pom.xml Removed com.github.javafaker:javafaker:1.0.2 (test-scope)

Verification

Check Result
./mvn-env.sh dependency:tree -pl projects/sitemanage,deliverytiersuite/delivery-tier-suite/metadata,modules/perc-security-utils -Dincludes=org.yaml:snakeyaml,com.github.javafaker javafaker gone everywhere. snakeyaml:1.23-android gone everywhere. Only snakeyaml:2.6 remains in sitemanage (runtime) and metadata (compile), from liquibase-core — already past the patched versions for all 8 CVEs.
./mvn-env.sh test -pl projects/sitemanage -Dtest=PSDefaultPasswordEncryptionBeanTest 1 run, 0 failures
./mvn-env.sh test-compile -pl deliverytiersuite/delivery-tier-suite/metadata BUILD SUCCESS (the metadata test class is a JUnit 3 TestCase hybrid; pre-existing surefire behavior on main, not a regression)

Why the determinism upgrade matters

The original Faker calls produced non-deterministic data on every test run (random character name, random animal, etc.). The replacement uses the existing entryIdx counter, so test runs are now reproducible. If a future failure is traced to "the abstract field had value X," X is now stable.

Closing the loop

After this merges, the next Dependabot re-scan of origin/main will not see snakeyaml:1.23-android in the dep graph at any scope. The 8 alerts (#102-#109) dismissed in the prior slice will not resurrect on re-scan, and the 16 CVEs in the analysis report (parent epic #73) are durably closed.

Closes #100.

Co-Authored by Mavis v1.0.0 using minimax-m3 with agent mavis.

…oves snakeyaml 1.x) (issue #100)

PR #99 removed javafaker from production (modules/perc-security-utils),
but two test files still declared javafaker at <scope>test</scope> in
their own poms, which kept org.yaml:snakeyaml:1.23-android reachable
on the test classpath. This slice removes those final javafaker usages
so the project dep graph has no snakeyaml:1.x left at any scope.

Replaces:
  - PSDefaultPasswordEncryptionBeanTest:
      faker.aquaTeenHungerForce().character().toString()
    with a UUID-based random string. Test only checks password
    round-trip, content is irrelevant.
  - PSMetadataQueryServiceTest:
      faker.chuckNorris().fact(), faker.hitchhikersGuideToTheGalaxy()
      .quote(), faker.animal().name() (x4)
    with per-entry deterministic strings ("linktext-{idx}",
    "abstract-{idx}", "cat-{idx}-a/b/c/d"). Tests assert on counts
    and structure, not on the specific text.

Removes the javafaker <dependency> blocks from:
  - projects/sitemanage/pom.xml
  - deliverytiersuite/delivery-tier-suite/metadata/pom.xml

Verified:
  - dependency:tree -pl projects/sitemanage,metadata,perc-security-utils
    -Dincludes=org.yaml:snakeyaml,com.github.javafaker
    All three modules return either empty (no snakeyaml at all) or
    snakeyaml:2.6 only. javafaker is gone everywhere.
  - ./mvn-env.sh test -pl projects/sitemanage
    -Dtest=PSDefaultPasswordEncryptionBeanTest -> 1 run, 0 failures.
  - ./mvn-env.sh test-compile -pl deliverytiersuite/delivery-tier-suite/metadata
    -> BUILD SUCCESS (the metadata test class is a JUnit 3 TestCase
    hybrid; same pre-existing surefire behavior on main, not a
    regression from this slice).

After this merge, the next Dependabot re-scan will not see
snakeyaml:1.23-android in the dep graph at any scope, so the 8
alerts (#102-#109) dismissed in the prior slice will not resurrect.

> Co-Authored by Mavis v1.0.0 using minimax-m3 with agent mavis.
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.

T2.x.2 hardening: drop test-scope javafaker in sitemanage and metadata (fully removes snakeyaml 1.x)

2 participants