Repository navigation
fix(scripts): rotate KYC keys via verification module entrypoints - #2989
Conversation
49b5462 to
be5193a
Compare
|
@ajetunmobiabdulsamad Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Hi @ajetunmobiabdulsamad — heads-up before we can merge this. Our malware scan found that an earlier commit on this branch carries a PolinRider malware payload (obfuscated code hidden after a long run of spaces in Please:
Once the branch history is clean and the PolinRider guard passes, we'll merge it. Thanks! |
a04045d to
bc4a6cf
Compare
Strips the payload this branch picked up (delete backend/api.js, unhook backend/package.json, truncate quicklendx-frontend/postcss.config.mjs). No functional change to the branch's own work.
152ae50 to
67af13c
Compare
67af13c to
60d58d0
Compare
60d58d0 to
09b7b12
Compare
09b7b12 to
659d44a
Compare
659d44a to
47c12e4
Compare
47c12e4 to
f0a75e8
Compare
|
Hi @ajetunmobiabdulsamad — thanks for removing the payload. The final diff is now clean, but this branch's commit history still contains the PolinRider malware (the earlier commit with obfuscated code hidden in config files and a How to fix (without opening the old branch in VS Code / Cursor): git fetch upstream main
git checkout -B <your-branch> upstream/main # start fresh from clean main
git checkout <your-last-commit> -- <only your own source/test files>
git commit -m "<your change>"
git push --force origin <your-branch>Please do not bring back As soon as the branch history is clean and the PolinRider guard passes, we will merge it. Thank you! |
|
@Baskarayelu — this PR is ready for another review. I resolved the merge conflicts with the main branch (pushed 27c79ad). |
b4a7563 to
17ecb85
Compare
17ecb85 to
90fbc72
Compare
90fbc72 to
3892134
Compare
3892134 to
78a0e4d
Compare
78a0e4d to
869b8b9
Compare
|
Warning Possible malicious code: please review before merging. An automated security scan flagged files in this pull request that appear to contain malicious code. Code like this can run automatically when a project is opened in an editor or its dependencies are installed, so it could compromise the machine of anyone who checks out this branch. Automated scans can be wrong, so this may be a false positive. Maintainers: please review the flagged files carefully before merging, on GitHub in your browser rather than by checking out the branch. The malicious part is often hidden far off to the right of an ordinary-looking line, so scroll sideways through each file. @ajetunmobiabdulsamad: this pull request adds or changes these files, possibly without your knowledge. Malware like this spreads by adding itself to repositories on machines it has infected, so your machine might be compromised. Please undo these changes in this pull request, and don't open or run other projects on that machine until you've checked it. Flagged files at commit
Only merge once you're confident these files are safe. ℹ️ Posted automatically by Drips Wave. Questions? Contact support@drips.network. |
07497c3 to
d896a9f
Compare
Overview
This PR fixes the KYC key-rotation script so it drives the KYC state machine through the contract's verification entrypoints (
verification.rs/kyc_policy.rs) instead of the broken draft wrappers in the unbuiltsrc/contract.rs. The draft wrappers were wrong in ways that would be dangerous if shipped:verify_investortook no admin argument and called a non-existentInvestorVerificationStorage::verify_investor(E0599),submit_kyc_application/submit_investor_kyctookByteswhile the module functions takeString(E0308), and the draftsubmit_investor_kycbypassedverification::submit_investor_kycentirely — skipping the investor'srequire_auth, the KYC event, and the audit entry.The change is scoped to
backend/scripts/rotate-kyc-keys.ts, which is the only file touched.Related Issue
Changes
🔑 KYC key rotation script
backend/scripts/rotate-kyc-keys.tsverification::submit_kyc_application(env, business, kyc_data: String)and approval/rejection throughverification::verify_business(env, admin, business)/verification::reject_business(env, admin, business, reason), so the adminrequire_auth()and the module's validation stay authoritative.verification::submit_investor_kyc(preserving the investorrequire_auth, KYC event, and audit entry that the draft bypassed) and approval throughverification::verify_investor(env, admin, investor, investment_limit) -> InvestorVerification, now passing the admin address explicitly.Stringrather thanBytes, matching the module signatures and the tighterMAX_KYC_DATA_LENGTH = 5_000bound enforced inverification.rs(returnsInvalidDescription).require_kyc_data_boundcall: it took&Byteswith an 8,192-byte ceiling (MAX_INPUT_KYC_DATA_BYTES), while the module functions already enforce the tighter 5,000-byte limit on theString.check_and_record_mutation(rate limit) before each mutating delegation, as the draft intended.get_business_verification_status/get_investor_verification, and list via the paged querieskyc_policy::get_businesses_paged/get_investors_paged(opaque cursor viaencode_cursor/decode_cursor) rather than the unboundedVec<Address>getters.delete_business/restore_businessout of the script — they need an authorization design first and are out of scope for this issue.Entrypoint → module mapping (as implemented)
submit_kyc_application(business, kyc_data: String)verification::submit_kyc_applicationverify_business(admin, business)verification::verify_businessreject_business(admin, business, reason)verification::reject_businessget_business_verification_status(business)submit_investor_kyc(investor, kyc_data: String)verification::submit_investor_kycverify_investor(admin, investor, investment_limit) -> InvestorVerificationverification::verify_investorreject_investor(admin, investor, reason)/revoke_investor_kyc(admin, investor, reason)set_investment_limit(admin, investor, new_limit)/recompute_investor_tier(admin, investor)get_investor_verification(investor)get_businesses_paged(status, cursor: Option<String>, limit) -> KycPageResult/get_investors_paged(...)kyc_policyVerification Results
submit_kyc_application/verify_business/reject_business/get_business_verification_statusverify_investorcannot be called without the admin's signatureverification::verify_investorcallsadmin.require_auth()MAX_KYC_DATA_LENGTH = 5_000,InvalidDescription)Stringpayloads passed through; draftrequire_kyc_data_bound(&Bytes, 8,192) removedget_businesses_paged/get_investors_pagedwith opaque cursordelete_business/restore_businessnot exposedGated legacy test cases
None. This PR only modifies
backend/scripts/rotate-kyc-keys.ts; it does not enabletest_business_kyc,test_investor_kyc, or addtest_kyc_entrypoints.rs. Those suites and the new contract entrypoints remain tracked under the contract-side scope of this issue.Out of Scope
delete_business/restore_business— need an authorization design first.verification.rs. In particular, business and investor records share the same raw-Addressstorage key, so one address cannot hold both roles andget_investors_pagedcan trap once a status list holds two or more investors; that is tracked separately. The script uses distinct addresses per role and does not page over two or more investors.Closes #2927