@vellumai/assistant 0.11.3-dev.202608131723.20f15a4 → 0.11.3-dev.202608131925.65f1085
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/package.json
CHANGED
|
@@ -722,12 +722,6 @@ describe("validateAttachmentUpload", () => {
|
|
|
722
722
|
expect(exeResult.error).toContain(".exe");
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
-
const shResult = validateAttachmentUpload("script.sh", "text/plain");
|
|
726
|
-
expect(shResult.ok).toBe(false);
|
|
727
|
-
if (!shResult.ok) {
|
|
728
|
-
expect(shResult.error).toContain(".sh");
|
|
729
|
-
}
|
|
730
|
-
|
|
731
725
|
const isoResult = validateAttachmentUpload(
|
|
732
726
|
"disk.iso",
|
|
733
727
|
"application/octet-stream",
|
|
@@ -738,6 +732,24 @@ describe("validateAttachmentUpload", () => {
|
|
|
738
732
|
}
|
|
739
733
|
});
|
|
740
734
|
|
|
735
|
+
test("accepts shell scripts as text attachments", () => {
|
|
736
|
+
expect(validateAttachmentUpload("script.sh", "text/plain").ok).toBe(true);
|
|
737
|
+
expect(validateAttachmentUpload("script.SH", "text/plain").ok).toBe(true);
|
|
738
|
+
expect(
|
|
739
|
+
validateAttachmentUpload("setup.sh", "application/x-sh").ok,
|
|
740
|
+
).toBe(true);
|
|
741
|
+
expect(
|
|
742
|
+
validateAttachmentUpload("run.sh", "application/x-shellscript").ok,
|
|
743
|
+
).toBe(true);
|
|
744
|
+
expect(validateAttachmentUpload("run.sh", "text/x-sh").ok).toBe(true);
|
|
745
|
+
expect(validateAttachmentUpload("run.sh", "text/x-shellscript").ok).toBe(
|
|
746
|
+
true,
|
|
747
|
+
);
|
|
748
|
+
expect(
|
|
749
|
+
validateAttachmentUpload("run.sh", "application/octet-stream").ok,
|
|
750
|
+
).toBe(true);
|
|
751
|
+
});
|
|
752
|
+
|
|
741
753
|
test("rejects dangerous extensions regardless of claimed MIME type", () => {
|
|
742
754
|
// .exe disguised as image/png
|
|
743
755
|
const result = validateAttachmentUpload("payload.exe", "image/png");
|
|
@@ -748,7 +760,9 @@ describe("validateAttachmentUpload", () => {
|
|
|
748
760
|
expect(
|
|
749
761
|
validateAttachmentUpload("PROGRAM.EXE", "application/octet-stream").ok,
|
|
750
762
|
).toBe(false);
|
|
751
|
-
expect(validateAttachmentUpload("
|
|
763
|
+
expect(validateAttachmentUpload("INSTALL.DMG", "application/octet-stream").ok).toBe(
|
|
764
|
+
false,
|
|
765
|
+
);
|
|
752
766
|
});
|
|
753
767
|
|
|
754
768
|
test("rejects unsupported MIME types", () => {
|
|
@@ -815,11 +829,6 @@ describe("validateAttachmentUpload", () => {
|
|
|
815
829
|
trustedSource: true,
|
|
816
830
|
}).ok,
|
|
817
831
|
).toBe(true);
|
|
818
|
-
expect(
|
|
819
|
-
validateAttachmentUpload("build.sh", "text/plain", {
|
|
820
|
-
trustedSource: true,
|
|
821
|
-
}).ok,
|
|
822
|
-
).toBe(true);
|
|
823
832
|
});
|
|
824
833
|
|
|
825
834
|
test("trustedSource: false keeps strict validation", () => {
|
|
@@ -477,6 +477,11 @@ const ALLOWED_MIME_TYPES = new Set([
|
|
|
477
477
|
// Source code
|
|
478
478
|
"text/javascript",
|
|
479
479
|
"text/typescript",
|
|
480
|
+
// Shell scripts (browsers and OS file pickers report these for .sh files)
|
|
481
|
+
"application/x-sh",
|
|
482
|
+
"application/x-shellscript",
|
|
483
|
+
"text/x-sh",
|
|
484
|
+
"text/x-shellscript",
|
|
480
485
|
// Archives
|
|
481
486
|
"application/zip",
|
|
482
487
|
"application/gzip",
|
|
@@ -504,7 +509,6 @@ const ALLOWED_MIME_TYPES = new Set([
|
|
|
504
509
|
*/
|
|
505
510
|
const DANGEROUS_EXTENSIONS = new Set([
|
|
506
511
|
"exe",
|
|
507
|
-
"sh",
|
|
508
512
|
"bat",
|
|
509
513
|
"cmd",
|
|
510
514
|
"com",
|