Skip to content

fix(security): T2.x hardening: drop javafaker in SecureStringUtils (closes 16 SnakeYAML CVEs) (issue #98) - #99

Merged
natechadwick merged 1 commit into
mainfrom
security/t2-x-snakeyaml-hardening
Aug 29, 2026
Merged

fix(security): T2.x hardening: drop javafaker in SecureStringUtils (closes 16 SnakeYAML CVEs) (issue #98)#99
natechadwick merged 1 commit into
mainfrom
security/t2-x-snakeyaml-hardening

Conversation

@natechadwick-intsof

Copy link
Copy Markdown
Collaborator

Summary

The 16 SnakeYAML CVEs in the analysis report (parent epic #73) come from the transitive org.yaml:snakeyaml:1.23-android dep that com.github.javafaker:javafaker:1.0.2 pulls in. commons-beanutils:1.11.0 does NOT declare SnakeYAML (issue #91 was closed as out-of-date). javafaker is stuck at 1.0.2 (Feb 2020), effectively unmaintained.

The single production use of javafaker is SecureStringUtils.generateRandomPassword(), which asks for "6-20 random alphanumeric chars with 0-5 special-char substitutions." That is a direct fit for SecureRandom. Rewrote the method body and removed javafaker from modules/perc-security-utils/pom.xml.

Changes

  • SecureStringUtils.generateRandomPassword() now uses SecureRandom directly via the existing getSecureRandom() helper on the same class. Semantics preserved:
    • Length: 6-20 chars (inclusive on both ends, matching the old Faker.lorem().characters(6, 20, true, true))
    • Alphabet: [A-Za-z0-9]
    • Special substitution: 0-5 positions overwritten with @$%^&*
  • com.github.javafaker.Faker import removed.
  • javafaker <dependency> block removed from modules/perc-security-utils/pom.xml.

What still uses javafaker (and is fine)

The two test classes that use new Faker() directly already declare javafaker at <scope>test</scope> in their own poms and are unaffected:

  • projects/sitemanage/.../PSDefaultPasswordEncryptionBeanTest.java (uses faker.aquaTeenHungerForce().character())
  • deliverytiersuite/delivery-tier-suite/metadata/.../PSMetadataQueryServiceTest.java (uses faker for test fixture data)

Verification

  • ./mvn-env.sh clean install -DskipTests -pl modules/perc-security-utils -am -BBUILD SUCCESS
  • ./mvn-env.sh dependency:tree -pl modules/perc-security-utils -Dincludes=org.yaml:snakeyaml,com.github.javafakerempty (both deps removed from the production classpath)
  • ./mvn-env.sh test -pl modules/perc-security-utils -Dtest=TestSecureStringUtils14 run, 0 failures, 0 errors, 1 skipped
  • ./mvn-env.sh test -pl projects/sitemanage -Dtest=PSDefaultPasswordEncryptionBeanTest1 run, 0 failures
  • ./mvn-env.sh test -pl deliverytiersuite/delivery-tier-suite/metadata -Dtest=PSMetadataQueryServiceTestpasses (javafaker still works in test scope)

CVEs closed

16 CVEs in the analysis report (the SnakeYAML bucket) — see the categorization in docs/ai-generated/tasks/PR#-DependencyVulnerabilityAnalysis/categorized-final.json.

Closes #98.

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

…loses 16 SnakeYAML CVEs) (issue #98)

The transitive snakeyaml:1.23-android dep that the analysis flagged with
16 CVEs comes from com.github.javafaker:javafaker:1.0.2 (stuck at that
version since Feb 2020). It is NOT from commons-beanutils (issue #91
was closed as out-of-date -- commons-beanutils 1.11.0 is the latest 1.x
and does not declare SnakeYAML).

The single production use of javafaker is
SecureStringUtils.generateRandomPassword(), which asked for
"6-20 random alphanumeric chars with 0-5 special-char substitutions."
That is a direct fit for SecureRandom. Rewrote the method body and
removed javafaker from modules/perc-security-utils/pom.xml.

The two remaining javafaker usages (PSDefaultPasswordEncryptionBeanTest
in sitemanage, PSMetadataQueryServiceTest in metadata) are already
<scope>test</scope> in their own poms and continue to work unchanged.

Verified:
  - ./mvn-env.sh clean install -DskipTests -pl modules/perc-security-utils -am
    BUILD SUCCESS
  - dependency:tree -pl modules/perc-security-utils
    -Dincludes=org.yaml:snakeyaml,com.github.javafaker
    returns empty (both deps are gone from the production classpath)
  - TestSecureStringUtils (14 tests, 0 failures, 1 skipped) passes
  - PSDefaultPasswordEncryptionBeanTest (1 test, 0 failures) passes
  - PSMetadataQueryServiceTest (compiles and runs) passes

Closes 16 CVEs in the analysis report that were attributed to
snakeyaml:1.23-android.

> Co-Authored by Mavis v1.0.0 using minimax-m3 with agent mavis.
@natechadwick
natechadwick merged commit 48a77a1 into main Aug 29, 2026
3 checks passed
@natechadwick
natechadwick deleted the security/t2-x-snakeyaml-hardening branch August 29, 2026 00:17
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 hardening: replace javafaker in SecureStringUtils.generateRandomPassword with SecureRandom (drops snakeyaml 1.23-android, closes 16 CVEs)

2 participants