📄 readme.security
字号:
$Id: README.SECURITY,v 3.0 2002/01/24 12:10:47 roessler Exp $Recently, there have been reports on security problems induced bythe interpretation of shell meta-characters embedded in MIMEparameters. These reports were referring to Pine, but the problemalso applied when using mutt.More precisely, a mailcap entry like this one would lead toproblems:> text/test-mailcap-bug; cat %s; copiousoutput; \> test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" != iso-8859-1When expanded with a charset parameter of ``touch${IFS}ME``, a filenamed "ME" would be created in the current directory.While we don't completely agree that this is an actual MUA problem(see below), we have implemented a couple of fixes for this:- Backticks are handled specially when preparing % expandos for mailcap entries. This fix will keep the current problem from occuring, but we are sure there are other possible mailcap entries where this doesn't help.- We have added a configuration variable named $mailcap_sanitize, which is set by default. If set, mutt will restrict possible characters in mailcap % expandos to a well-defined set of safe characters. This is the safe setting, but we are not sure it doesn't break some more advanced MIME stuff.>>> DON'T UNSET THIS OPTION UNLESS YOU KNOW WHAT YOU ARE DOING.Anyway, this problem is not necessarily a problem which should besolved inside the MUA, as it's difficult (maybe impossible) to solvethere. Additionally, there is more than one program which parsesmailcap. So writing secure mailcap statements is generally a goodidea. We encourage you to do this.The most basic rule is this one:>>> KEEP THE %-EXPANDOS AWAY FROM SHELL QUOTING.Don't quote them with single or double quotes. Mutt does this foryou, the right way, as should any other program which interpretsmailcap. Don't put them into backtick expansions - as you have seenabove, this is a recipe for disaster. Be highly careful with evalstatements, and avoid them if possible at all.If you have to use the %-expandos' values in context where you needquoting or backtick expansions, put that value into a shell variableand reference the shell variable where necessary (possibly with theproper quoting put around it, like in "$charset").For example, a safe version of the mailcap statement above couldlook like this:> text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \> && test "`echo \"$charset\" | tr '[A-Z]' '[a-z]'`" != iso-8859-1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -