@@ -705,7 +705,9 @@ open class Terminal {
705
705
ok = 0 // this means the request is not valid, report that to the host.
706
706
// invalid: DCS 0 $ r Pt ST (xterm)
707
707
terminal. log ( " Unknown DCS + \( newData!) " )
708
- result = newData ?? " "
708
+ // Do not report 'newData', because it can be exploited
709
+ // see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510030
710
+ result = " "
709
711
710
712
}
711
713
terminal. sendResponse ( terminal. cc. DCS, " \( ok) $r \( result) " , terminal. cc. ST)
@@ -2638,11 +2640,13 @@ open class Terminal {
2638
2640
sendResponse ( cc. CSI, " 9; \( rows) ; \( cols) t " )
2639
2641
}
2640
2642
case [ 20 ] :
2641
- let it = iconTitle. replacingOccurrences ( of: " \\ " , with: " " )
2642
- sendResponse ( cc. OSC, " L \( it) " , cc. ST)
2643
+ // Do not report the actual title back, as it can be exploited,
2644
+ // https://marc.info/?l=bugtraq&m=104612710031920&w=2
2645
+ sendResponse ( cc. OSC, " L " , cc. ST)
2643
2646
case [ 21 ] :
2644
- let tt = terminalTitle. replacingOccurrences ( of: " \\ " , with: " " )
2645
- sendResponse ( cc. OSC, " l \( tt) " , cc. ST)
2647
+ // Do not report the actual content of the title back, as it can be exploited,
2648
+ // https://marc.info/?l=bugtraq&m=104612710031920&w=2
2649
+ sendResponse ( cc. OSC, " l " , cc. ST)
2646
2650
case [ 22 , 0 ] :
2647
2651
terminalTitleStack = terminalTitleStack + [ terminalTitle]
2648
2652
terminalIconStack = terminalIconStack + [ iconTitle]
0 commit comments