@xyne/workflow-sdk 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/types.d.ts +10 -0
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/workflow-client.d.ts.map +1 -1
- package/dist/client/workflow-client.js +10 -0
- package/dist/client/workflow-client.js.map +1 -1
- package/dist/router/workflow-router.d.ts.map +1 -1
- package/dist/router/workflow-router.js +10 -0
- package/dist/router/workflow-router.js.map +1 -1
- package/dist/runtime/workflow-runtime.d.ts +11 -0
- package/dist/runtime/workflow-runtime.d.ts.map +1 -1
- package/dist/runtime/workflow-runtime.js +46 -0
- package/dist/runtime/workflow-runtime.js.map +1 -1
- package/package.json +1 -1
- package/dist/common/principal.d.ts +0 -45
- package/dist/common/principal.d.ts.map +0 -1
- package/dist/common/principal.js +0 -9
- package/dist/common/principal.js.map +0 -1
- package/dist/steps/builtin/transform.step.d.ts +0 -247
- package/dist/steps/builtin/transform.step.d.ts.map +0 -1
- package/dist/steps/builtin/transform.step.js +0 -135
- package/dist/steps/builtin/transform.step.js.map +0 -1
- package/dist/types/attachment.d.ts +0 -23
- package/dist/types/attachment.d.ts.map +0 -1
- package/dist/types/attachment.js +0 -2
- package/dist/types/attachment.js.map +0 -1
- package/dist/types/resume-payload.d.ts +0 -34
- package/dist/types/resume-payload.d.ts.map +0 -1
- package/dist/types/resume-payload.js +0 -12
- package/dist/types/resume-payload.js.map +0 -1
- package/dist/util/executable-check.d.ts +0 -42
- package/dist/util/executable-check.d.ts.map +0 -1
- package/dist/util/executable-check.js +0 -115
- package/dist/util/executable-check.js.map +0 -1
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Executable upload safety check.
|
|
3
|
-
*
|
|
4
|
-
* Allow-by-default with a deny-list of known dangerous types — covers the
|
|
5
|
-
* common attack surface (native binaries, scripts that auto-run, installers,
|
|
6
|
-
* macro-enabled Office docs) without forcing workflow authors to enumerate
|
|
7
|
-
* every safe MIME type.
|
|
8
|
-
*
|
|
9
|
-
* Two checks run in parallel so spoofed MIME types alone can't bypass:
|
|
10
|
-
* 1. MIME type matches the deny-list
|
|
11
|
-
* 2. Filename extension matches the deny-list
|
|
12
|
-
*
|
|
13
|
-
* Either match blocks the upload. To accept executables (e.g. a security-
|
|
14
|
-
* analysis workflow that intentionally examines binaries), the host opts
|
|
15
|
-
* in via `RuntimeOptions.allowExecutableUploads = true`.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* MIME types treated as executable / unsafe (lowercase — input is also
|
|
19
|
-
* lowercased before comparison).
|
|
20
|
-
*/
|
|
21
|
-
export const BLOCKED_EXECUTABLE_MIME_TYPES = new Set([
|
|
22
|
-
// Native binaries
|
|
23
|
-
'application/x-msdownload',
|
|
24
|
-
'application/x-msdos-program',
|
|
25
|
-
'application/x-executable',
|
|
26
|
-
'application/x-mach-binary',
|
|
27
|
-
'application/vnd.microsoft.portable-executable',
|
|
28
|
-
'application/x-msi',
|
|
29
|
-
'application/x-ms-installer',
|
|
30
|
-
// Shell + Windows scripts
|
|
31
|
-
'application/x-sh',
|
|
32
|
-
'application/x-shellscript',
|
|
33
|
-
'application/x-bat',
|
|
34
|
-
'application/x-csh',
|
|
35
|
-
'application/x-cmd',
|
|
36
|
-
'application/x-msmetafile',
|
|
37
|
-
// JavaScript / ECMAScript
|
|
38
|
-
'text/javascript',
|
|
39
|
-
'application/javascript',
|
|
40
|
-
'application/ecmascript',
|
|
41
|
-
'application/x-javascript',
|
|
42
|
-
// Java / Flash
|
|
43
|
-
'application/java-archive',
|
|
44
|
-
'application/x-java-archive',
|
|
45
|
-
'application/x-java-jnlp-file',
|
|
46
|
-
'application/x-shockwave-flash',
|
|
47
|
-
// Installer / package formats that bundle executables
|
|
48
|
-
'application/vnd.android.package-archive',
|
|
49
|
-
'application/x-debian-package',
|
|
50
|
-
'application/x-rpm',
|
|
51
|
-
// Macro-enabled Office documents (lowercased — IANA tokens are case-insensitive)
|
|
52
|
-
'application/vnd.ms-word.document.macroenabled.12',
|
|
53
|
-
'application/vnd.ms-word.template.macroenabled.12',
|
|
54
|
-
'application/vnd.ms-excel.sheet.macroenabled.12',
|
|
55
|
-
'application/vnd.ms-excel.template.macroenabled.12',
|
|
56
|
-
'application/vnd.ms-excel.addin.macroenabled.12',
|
|
57
|
-
'application/vnd.ms-excel.sheet.binary.macroenabled.12',
|
|
58
|
-
'application/vnd.ms-powerpoint.presentation.macroenabled.12',
|
|
59
|
-
'application/vnd.ms-powerpoint.template.macroenabled.12',
|
|
60
|
-
'application/vnd.ms-powerpoint.addin.macroenabled.12',
|
|
61
|
-
]);
|
|
62
|
-
/**
|
|
63
|
-
* File extensions treated as executable / unsafe (case-insensitive, no dot).
|
|
64
|
-
* The check uses the LAST extension so `report.exe.txt` is treated as text
|
|
65
|
-
* (Windows shows the trailing extension, which is what the user actually sees).
|
|
66
|
-
*/
|
|
67
|
-
export const BLOCKED_EXECUTABLE_EXTENSIONS = new Set([
|
|
68
|
-
// Windows
|
|
69
|
-
'exe', 'msi', 'com', 'scr', 'cmd', 'bat', 'ps1', 'psm1',
|
|
70
|
-
'vbs', 'vbe', 'wsf', 'wsh', 'hta', 'cpl', 'lnk',
|
|
71
|
-
'dll', 'sys', 'drv', 'ocx',
|
|
72
|
-
// macOS / Unix
|
|
73
|
-
'app', 'dmg', 'pkg',
|
|
74
|
-
'sh', 'bash', 'zsh', 'fish', 'csh', 'ksh', 'command', 'tool',
|
|
75
|
-
// Java / Flash
|
|
76
|
-
'jar', 'war', 'jnlp', 'swf',
|
|
77
|
-
// Mobile installers
|
|
78
|
-
'apk', 'ipa', 'xap',
|
|
79
|
-
// Linux installers
|
|
80
|
-
'deb', 'rpm', 'run', 'bin',
|
|
81
|
-
// JavaScript (auto-executes in browser / Node contexts)
|
|
82
|
-
'js', 'mjs', 'cjs',
|
|
83
|
-
// Macro-enabled Office
|
|
84
|
-
'docm', 'dotm', 'xlsm', 'xltm', 'xlam', 'xlsb',
|
|
85
|
-
'pptm', 'potm', 'ppam', 'ppsm', 'sldm',
|
|
86
|
-
]);
|
|
87
|
-
/**
|
|
88
|
-
* Extract the lowercase extension (no dot) from a filename, or '' if none.
|
|
89
|
-
* A leading dot doesn't count — `.bashrc` has no extension, not "bashrc".
|
|
90
|
-
*/
|
|
91
|
-
export function extensionOf(name) {
|
|
92
|
-
const dot = name.lastIndexOf('.');
|
|
93
|
-
if (dot <= 0 || dot === name.length - 1)
|
|
94
|
-
return '';
|
|
95
|
-
return name.slice(dot + 1).toLowerCase();
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Returns a human-readable reason if the file should be blocked as
|
|
99
|
-
* executable, or `null` if it's safe.
|
|
100
|
-
*
|
|
101
|
-
* Always check both the MIME type and the filename — clients can spoof one
|
|
102
|
-
* but rarely both. This is defense-in-depth, not authoritative malware
|
|
103
|
-
* detection (run real AV at the storage layer for that).
|
|
104
|
-
*/
|
|
105
|
-
export function isExecutable(mimeType, name) {
|
|
106
|
-
if (BLOCKED_EXECUTABLE_MIME_TYPES.has(mimeType.toLowerCase())) {
|
|
107
|
-
return `Executable MIME type "${mimeType}" is not allowed.`;
|
|
108
|
-
}
|
|
109
|
-
const ext = extensionOf(name);
|
|
110
|
-
if (ext && BLOCKED_EXECUTABLE_EXTENSIONS.has(ext)) {
|
|
111
|
-
return `Files with .${ext} extension are not allowed.`;
|
|
112
|
-
}
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
//# sourceMappingURL=executable-check.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executable-check.js","sourceRoot":"","sources":["../../src/util/executable-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAwB,IAAI,GAAG,CAAC;IACxE,kB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