|
2017-05-03
| ||
| 12:25 | • Closed ticket [51ded417dd]: Need test to ensure %p is not exposed to scripts... artifact: 21d67ac767 user: jan.nijtmans | |
|
2017-04-05
| ||
| 09:49 | • Pending ticket [51ded417dd]. artifact: f1ab52e482 user: jan.nijtmans | |
|
2017-04-03
| ||
| 12:54 | • Ticket [51ded417dd]: 3 changes artifact: 465f443808 user: jan.nijtmans | |
|
2017-04-02
| ||
| 22:59 | • Ticket [51ded417dd]: 3 changes artifact: c24144cdd0 user: dkf | |
| 22:59 | • New ticket [51ded417dd]. artifact: 6846d64693 user: dkf | |
Need test to ensure %p is not exposed to scripts
Closed / Works For Me51ded417dde97f04b68eb6710ff16e31fa7b9906Created 10 years agoUpdated 10 years ago
Descriptionhtml2017-04-02 22:59:04
While it is fine to have Tcl's Tcl_AppendPrintfToObj (et al) accept %p, we definitely do not want that capability exposed to Tcl scripts. Therefore, we should add code to make sure that neither format nor scan support it; an error indicating a bad format sequence should be received in these cases. We might be getting it right now, but we need to be ever so careful as these have been areas which have had security errors in the past in other languages (the ones that just throw it to C's sprintf/sscanf). Much better safe than sorry.
dkf Ticket [51ded417dd]: 3 changes
[History diff]2017-04-02 22:59:21
jan.nijtmansplain2017-04-03 12:54:34
Concern understood! However, since Tcl_AppendPrintfToObj uses the internal "format" machinery, it's not easy to generate an error out of this situation. Besides... Since on the script level, Tcl doesn't know pointers, it's actually not dangerous at all! Since "%p" is equal to "%#llx" on 64-bit platforms and "%#x" on 32-bit platforms, there is no way that pointers values can be accessed. Added test-cases now to show that. Since neither "%#llu" nor "%#u" form any security risk, I claim that neither does "%p". The danger only occurs when a pointer is addressed, but that's impossible to be done from the script level. Only printing the value can never do any harm.
jan.nijtmans Pending ticket [51ded417dd].
[History diff]2017-04-05 09:49:22
jan.nijtmans Closed ticket [51ded417dd].
[History diff]2017-05-03 12:25:25
Log in (anonymous is fine) to add a comment.