Skip to content

fix(security): require acknowledgement before depositing into non-Yearn vaults - #1493

Merged
matheus1lva merged 2 commits into
mainfrom
matheus1lva/sec-non-yearn-vault-gate
Nov 24, 2026
Merged

matheus1lva merged 2 commits into
mainfrom
matheus1lva/sec-non-yearn-vault-gate

Conversation

@matheus1lva

@matheus1lva matheus1lva commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Kong indexes ERC-4626 vaults that Yearn did not deploy, and /vaults/[chainID]/[address] renders any vault Kong knows about. Vaults that isNonYearnErc4626Vault flags (Kong origin !== 'yearn' or inclusion.isYearn === false) already showed a warning banner and non-Yearn metadata, but kept a live Deposit action and stayed indexable.

For flagged vaults only, this PR:

  • Requires an explicit acknowledgement before any funds-in action. In the Deposit (and Migrate) mode, the desktop widget and mobile drawer render an acknowledgement panel ("This vault is not endorsed by Yearn." … "I understand, continue") instead of the widget. Before acknowledgement the shared Widget is not given those actions at all, so it cannot build a deposit transaction. Withdraw is never gated. The acknowledgement lasts for the browser session and applies to one chain + address (sessionStorage).
  • Sets robots: { index: false, follow: false } in the vault page metadata (buildVaultMetadataFromInput, used by /vaults/... and /v3/...). Yearn vault pages keep the layout's index, follow.
  • Shows the vault address next to the name in the page heading (desktop header and mobile h1), e.g. Name · 0x1234...abcd, because the name is chosen by whoever deployed the vault.

Yearn vault pages are unchanged.

Verification

  • bun run tslint, bun run lint:fix clean; bun run test: 194 files / 1139 tests pass.
  • New tests in vaultWarnings.test.ts (gating rule, storage-key scope, heading) and app/metadata.test.ts (robots). They fail on main and pass on this branch.
  • Checked locally in the browser (desktop and mobile viewports).

On the preview

  1. Non-Yearn vault: /vaults/1/0xcb1Eb72F2a27E9EAD2e2Fb3F0AAC7E4Ee39F2EeB
    • Heading shows USDC to yvUSDS-1 Depositor · 0xcb1E...2EeB.
    • Deposit tab shows the acknowledgement panel and no amount input. Withdraw tab shows the normal withdraw form.
    • After clicking "I understand, continue", the deposit form appears and stays available after a reload in the same tab. A new browser session asks again.
    • <meta name="robots" content="noindex, nofollow"> in the page source (note: Vercel previews are also blocked by robots.txt, so check the meta tag itself).
  2. Yearn vault (unchanged): /vaults/1/0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204. Deposit form shows straight away, heading has no address, robots meta is index, follow.

🤖 Generated with Claude Code

…rn vaults

Vault pages for ERC-4626 vaults Kong does not attribute to Yearn kept a live
Deposit action behind only a warning banner. For those vaults:

- Deposit and Migrate render an acknowledgement panel instead of the widget
  until the user confirms, once per browser session per vault, that the vault
  is not a Yearn vault. The widget is not given those actions before then.
  Withdraw is never gated.
- Page metadata sets robots noindex/nofollow. Yearn vault pages are unchanged.
- The page heading shows the vault address next to the deployer-chosen name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
yearnfi Ready Ready Preview Nov 24, 2026 2:12pm UTC

Request Review

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Deploy preview for yearn-bold ready!

Project:yearn-bold
Status: ✅  Deploy successful!
Preview URL:https://yearn-bold-d6art5im8-yearn.vercel.app
Latest Commit:4b4555b

Deployed with vercel-action

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Deploy preview for yearn-fi ready!

Project:yearn-fi
Status: ✅  Deploy successful!
Preview URL:https://yearnfi-br68w77er-yearn.vercel.app
Latest Commit:4b4555b

Deployed with vercel-action

…ird-party

The flag means the vault is not on Yearn's endorsed list. It also covers
Yearn's own tokenized strategies and established third-party vaults, so the
panel should not claim the vault was deployed by an unknown third party.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matheus1lva
matheus1lva merged commit 7653938 into main Nov 24, 2026
14 checks passed
@matheus1lva
matheus1lva deleted the matheus1lva/sec-non-yearn-vault-gate branch November 24, 2026 14:15

This branch was successfully deployed

1 active deployment
preview — 4b4555b1 Deployed Nov 24, 2026 by github-actions[bot]
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.

1 participant