Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

chore(security): validate the Gradle wrapper, pin its distribution, drop a bank lookalike

Nandakishordc721331e71b
diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml
index d41f77a5..5e6c6cb2 100644
--- a/.github/workflows/java.yml
+++ b/.github/workflows/java.yml
@@ -40,6 +40,12 @@ jobs:
timeout-minutes: 25
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+ # `gradle/wrapper/gradle-wrapper.jar` is a binary that executes at build time, so it is
+ # the one file in this tree a reviewer cannot read. This validates it against Gradle's
+ # published checksums before anything runs it. The jar in the tree today is the genuine
+ # 8.10.2 wrapper (sha256 2db75c40...8046, matching services.gradle.org and the
+ # gradle/gradle v8.10.2 tag); this keeps a later swap from going unnoticed.
+ - uses: gradle/actions/wrapper-validation@0b6dd653ba04f4f93bf581ec31e66cbd7dcb644d # v4
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: temurin
diff --git a/examples/13_email_state_and_cleaning.py b/examples/13_email_state_and_cleaning.py
index 0760add8..4bc8eb4d 100644
--- a/examples/13_email_state_and_cleaning.py
+++ b/examples/13_email_state_and_cleaning.py
@@ -83,7 +83,7 @@ print(" -> same verdict, %d fewer input tokens: cleaning buys headroom, not ac
PHISH_BODY = """URGENT: Your account has been locked for security reasons.
-Verify immediately at http://wellsfargo--verify.tj49.wsipv6.com or it will be closed
+Verify immediately at http://secure-bank--verify.account-check.example or it will be closed
permanently.
Best regards,
@@ -100,9 +100,9 @@ On Mon, 11 Mar 2024 at 09:12, Billing Support <[email protected]> wrote:
heading("a phishing lure with an innocent quoted tail")
phish_clean = laya.email_state("Urgent: your account is locked", PHISH_BODY,
phish_raw = laya.email_state("Urgent: your account is locked", PHISH_BODY,
- "[email protected]", clean=False)
+ "[email protected]", clean=False)
print(" cleaned state:")
describe(agent.predict(phish_clean, EMAIL_QUESTIONS)["answers"], indent=" ")
print(" raw state:")
diff --git a/examples/25_preset_email_phishing.py b/examples/25_preset_email_phishing.py
index 671ea3a5..c90d2fed 100644
--- a/examples/25_preset_email_phishing.py
+++ b/examples/25_preset_email_phishing.py
@@ -27,9 +27,9 @@ MESSAGES = [
("phishing lure",
"Urgent: your account has been locked",
"Dear customer,\n\nWe detected unusual activity on your account and locked it for "
- "security reasons.\n\nVerify immediately at http://wellsfargo--verify.tj49.wsipv6.com "
+ "security reasons.\n\nVerify immediately at http://secure-bank--verify.account-check.example "
"or the account will be closed permanently.\n\nBest regards,\nAccount Security Team",
("billing request",
"Invoice 4411 duplicate charge",
"Hi billing team,\n\nOur finance system shows two separate captures for the same order, "
diff --git a/laya-java/gradle/wrapper/gradle-wrapper.properties b/laya-java/gradle/wrapper/gradle-wrapper.properties
index df97d72b..22f460ba 100644
--- a/laya-java/gradle/wrapper/gradle-wrapper.properties
+++ b/laya-java/gradle/wrapper/gradle-wrapper.properties
@@ -2,6 +2,9 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
+# Pins the distribution the wrapper downloads. Without it the wrapper trusts whatever
+# services.gradle.org returns; the wrapper jar itself is validated in CI (java.yml).
+distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/tests/test_local_e2e.py b/tests/test_local_e2e.py
index ca4905e3..3bfbfe32 100644
--- a/tests/test_local_e2e.py
+++ b/tests/test_local_e2e.py
@@ -161,7 +161,7 @@ print("\n -- phishing / email triage --", flush=True)
PHISH = [
("phishing", "[email protected]", "Urgent: your account is locked",
"Your account has been locked for security reasons. Verify immediately at "
- "http://wellsfargo--verify.tj49.wsipv6.com or it will be closed permanently.", True),
+ "http://secure-bank--verify.account-check.example or it will be closed permanently.", True),
("legit billing", "[email protected]", "Invoice 4411 duplicate charge",
"Hi, we were billed twice for invoice 4411 in March. Could you refund the duplicate? Thanks.", False),
("legit newsletter", "[email protected]", "PyCon 2026 schedule is live",