@@ -56,17 +56,13 @@ function wrapUntrustedAttachmentContent(content: string): string {
5656 return wrapExternalContent ( content , { source : "unknown" , includeWarning : false } ) ;
5757}
5858
59- // Absolute host paths from the managed media store only; bounded, and
60- // restricted by rejecting the characters that could smuggle prompt markup,
61- // control tokens, or external-content markers into the directive. Letters and
62- // digits of any script pass: filenames are routinely non-Latin, and dropping
63- // the directive for them would silently restore the dead-end for those users.
59+ // Absolute host paths from the managed media store only; bounded to a positive
60+ // alphabet that cannot carry prompt markup or executable shell syntax. Letters
61+ // and digits of any script pass so ordinary non-Latin filenames keep working.
6462const MARKER_LOCAL_PATH_MAX_CHARS = 300 ;
6563const POSIX_ABSOLUTE_PATH = / ^ \/ / ;
6664const WINDOWS_ABSOLUTE_PATH = / ^ [ A - Z a - z ] : \\ / ;
67- // Control chars, bidi/zero-width overrides, and prompt-structural punctuation.
68- const MARKER_PATH_FORBIDDEN =
69- / [ \p{ C} \p{ Zl} \p{ Zp} \u200b - \u200f \u202a - \u202e \u2066 - \u2069 < > [ \] { } " ' ` | * ? ] / u;
65+ const MARKER_PATH_SAFE = / ^ [ \p{ L} \p{ M} \p{ N} / \\ : . _ - ] + $ / u;
7066
7167function markerSafeLocalPath ( value ?: string ) : string | undefined {
7268 if ( ! value || value . length > MARKER_LOCAL_PATH_MAX_CHARS ) {
@@ -75,7 +71,7 @@ function markerSafeLocalPath(value?: string): string | undefined {
7571 if ( ! POSIX_ABSOLUTE_PATH . test ( value ) && ! WINDOWS_ABSOLUTE_PATH . test ( value ) ) {
7672 return undefined ;
7773 }
78- return MARKER_PATH_FORBIDDEN . test ( value ) ? undefined : value ;
74+ return MARKER_PATH_SAFE . test ( value ) ? value : undefined ;
7975}
8076
8177const SKIPPED_FILE_OUTCOME_KINDS = new Set < FileAttachmentOutcome [ "kind" ] > ( [
0 commit comments