Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
Remove completed private V6 one-shot dependency security diagnostic workflows
davoodmehraban89 committed
Oct 18, 2026 at 14:30 UTC
5792e3392be076b3f2dbdc3247bc67b02ba1b25e
1 file changed
-108
.github/workflows/v6-patched-sheetjs-security-once.yml
deleted
-108
@@ -1,108 +0,0 @@
1
-name: TreasuryFlow V6 official patched SheetJS 0.20.3 security regression (NOT V7)
2
-on:
3
- push:
4
- branches: ['ci/public-windows-bridge-probe-20261017']
5
- paths: ['.github/workflows/v6-patched-sheetjs-security-once.yml']
6
-permissions:
7
- contents: read
8
-jobs:
9
- patched-xlsx:
10
- runs-on: ubuntu-22.04
11
- timeout-minutes: 20
12
- env:
13
- BANK_ADAPTER_MODE: disabled
14
- TREASURYFLOW_ENABLE_MAYAN_EXTERNAL_READ: '0'
15
- TREASURYFLOW_MAYAN_ENABLE_EXTERNAL_READ: '0'
16
- TREASURYFLOW_ENABLE_SQL_LAB: '0'
17
- steps:
18
- - name: Verify immutable private V6 input using step-only private read token
19
- env:
20
- GH_TOKEN: ${{ secrets.TF_VALIDATION_READ_TOKEN }}
21
- shell: bash
22
- run: |
23
- set -euo pipefail
24
- test -n "$GH_TOKEN"
25
- gh release download validation-inputs-20261017 --repo davoodmehraban89/TreasuryFlow-Validation-Private --pattern TreasuryFlow_Validation_Staging_20261017.zip --dir "$RUNNER_TEMP" >/dev/null 2>&1
26
- f="$RUNNER_TEMP/TreasuryFlow_Validation_Staging_20261017.zip"
27
- test "$(sha256sum "$f" | cut -d' ' -f1)" = '9ce46ce2d2a437e08cbf28146b2cf2ac0ed078c71f1aeb537764390cdd3c552f'
28
- mkdir -p "$RUNNER_TEMP/private-v6-source"
29
- unzip -q "$f" -d "$RUNNER_TEMP/private-v6-source"
30
- echo "TF_ROOT=$RUNNER_TEMP/private-v6-source" >> "$GITHUB_ENV"
31
- echo 'PRIVATE_STAGING_SHA256_PASS'
32
- - name: Setup Node 22
33
- uses: actions/setup-node@v4
34
- with:
35
- node-version: '22'
36
- - name: Replace vulnerable old npm xlsx with official vendor-patched 0.20.3 tarball in ephemeral staging
37
- shell: bash
38
- run: |
39
- set -euo pipefail
40
- cd "$TF_ROOT"
41
- npm ci --no-audit --no-fund > "$RUNNER_TEMP/private-npm-ci.log" 2>&1
42
- curl -fsSL --retry 3 --max-time 90 https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz -o "$RUNNER_TEMP/vendor-patched-xlsx-0.20.3.tgz" > "$RUNNER_TEMP/vendor-download.log" 2>&1
43
- test "$(wc -c < "$RUNNER_TEMP/vendor-patched-xlsx-0.20.3.tgz")" -gt 100000
44
- vendorDigest=$(sha256sum "$RUNNER_TEMP/vendor-patched-xlsx-0.20.3.tgz" | cut -d' ' -f1)
45
- echo "VENDOR_OFFICIAL_XLSX_0_20_3_SHA256=$vendorDigest"
46
- npm uninstall xlsx --save --no-audit --no-fund > "$RUNNER_TEMP/private-uninstall-vulnerable.log" 2>&1
47
- npm install --save --ignore-scripts --no-audit --no-fund https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz > "$RUNNER_TEMP/private-install-vendor.log" 2>&1
48
- node -e 'const x=require("xlsx");if(x.version!=="0.20.3"){process.exit(2)};console.log("GATE_PASS_OFFICIAL_PATCHED_SHEETJS_VERSION")'
49
- npm ci --no-audit --no-fund > "$RUNNER_TEMP/private-lock-reinstall.log" 2>&1
50
- echo 'GATE_PASS_PATCHED_SHEETJS_LOCK_REPRODUCIBILITY'
51
- - name: Verify zero known production npm audit advisories without suppressing audit
52
- shell: bash
53
- run: |
54
- cd "$TF_ROOT"
55
- npm audit --omit=dev --json > "$RUNNER_TEMP/private-vendor-audit.json" 2> "$RUNNER_TEMP/private-vendor-audit-stderr.log" || true
56
- node -e '
57
- const fs=require("fs");
58
- const x=JSON.parse(fs.readFileSync(process.env.RUNNER_TEMP+"/private-vendor-audit.json","utf8"));
59
- const v=x.metadata?.vulnerabilities;
60
- if(!v)process.exit(10);
61
- for(const k of ["critical","high","moderate","low","total"])console.log("PATCHED_PRODUCTION_AUDIT_"+k.toUpperCase()+"="+Number(v[k]||0));
62
- if(Number(v.critical||0)||Number(v.high||0)){process.exit(11)}
63
- console.log("GATE_PASS_PATCHED_PRODUCTION_SECURITY_AUDIT_NO_HIGH_OR_CRITICAL");
64
- '
65
- - name: Rerun unit tests, TypeScript, lint and production build against patched SheetJS
66
- shell: bash
67
- run: |
68
- set -euo pipefail
69
- cd "$TF_ROOT"
70
- npm test -- --reporter=json "--outputFile=$RUNNER_TEMP/private-tests-patched.json" > "$RUNNER_TEMP/private-tests-patched.log" 2>&1 || true
71
- test -s "$RUNNER_TEMP/private-tests-patched.json" || { echo 'PATCHED_XLSX_TEST_JSON_ABSENT'; exit 1; }
72
- cat > "$RUNNER_TEMP/sanitized-failures.mjs" <<'NODE'
73
- import fs from 'node:fs';
74
- import crypto from 'node:crypto';
75
- const x=JSON.parse(fs.readFileSync(process.argv[2],'utf8'));
76
- console.log('PATCHED_UNIT_TOTAL='+Number(x.numTotalTests||0));
77
- console.log('PATCHED_UNIT_PASS='+Number(x.numPassedTests||0));
78
- console.log('PATCHED_UNIT_FAIL='+Number(x.numFailedTests||0));
79
- console.log('PATCHED_UNIT_PENDING='+Number(x.numPendingTests||0));
80
- const files=(x.testResults||[]);
81
- let count=0;
82
- for(const t of files)for(const a of t.assertionResults||[])if(a.status==='failed'){
83
- count++;
84
- const marker=crypto.createHash('sha256').update(String(a.fullName||a.title)).digest('hex').slice(0,10);
85
- const words=String(a.fullName||a.title).toLowerCase()+' '+(a.failureMessages||[]).join(' ').toLowerCase();
86
- const known=['xlsx','excel','import','export','workbook','worksheet','csv','file','schema','sql','mayan','security','read','write','buffer','json','parse','transform'];
87
- console.log('PATCHED_FAIL_'+count+'_HASH='+marker);
88
- console.log('PATCHED_FAIL_'+count+'_TOPIC='+known.filter(k=>words.includes(k)).join(','));
89
- const classes=['AssertionError','TypeError','ReferenceError','SyntaxError','RangeError','TimeoutError','ModuleNotFoundError'];
90
- console.log('PATCHED_FAIL_'+count+'_CLASS='+(classes.find(c=>(a.failureMessages||[]).join(' ').includes(c))||'OTHER'));
91
- if(count>=8)break;
92
- }
93
- NODE
94
- node "$RUNNER_TEMP/sanitized-failures.mjs" "$RUNNER_TEMP/private-tests-patched.json"
95
- node -e 'let x=require(process.argv[1]);if(x.numFailedTests||!x.numPassedTests)process.exit(3)' "$RUNNER_TEMP/private-tests-patched.json" || { echo 'PATCHED_XLSX_UNIT_TESTS_FAILED_SANITIZED'; exit 1; }
96
- echo 'GATE_PASS_SHEETJS_PATCHED_UNIT_TESTS'
97
- npm run typecheck > "$RUNNER_TEMP/private-typecheck-patched.log" 2>&1 || { echo 'PATCHED_XLSX_TYPECHECK_FAILED'; exit 1; }
98
- echo 'GATE_PASS_SHEETJS_PATCHED_TYPECHECK'
99
- npm run lint > "$RUNNER_TEMP/private-lint-patched.log" 2>&1 || { echo 'PATCHED_XLSX_LINT_FAILED'; exit 1; }
100
- echo 'GATE_PASS_SHEETJS_PATCHED_LINT'
101
- npm run build > "$RUNNER_TEMP/private-next-patched.log" 2>&1 || { echo 'PATCHED_XLSX_BUILD_FAILED'; exit 1; }
102
- echo 'GATE_PASS_SHEETJS_PATCHED_NEXT_BUILD'
103
- - name: Zero public private-source artifact policy
104
- if: always()
105
- run: |
106
- echo 'SCOPE=V6_EPHEMERAL_OFFICIAL_VENDOR_XLSX_CDN_REPLACEMENT'
107
- echo 'NO_PRIVATE_SOURCE_PACKAGE_LOCK_OR_TEST_LOGS_UPLOADED'
108
- echo 'V7_FINAL=NOT_TESTED'