| re: [Q] mail() & security
Daniel Tryba <partmapsswen@invalid.tryba.nl> wrote:
[color=blue]
> Eric <egusenet@verizon.net> wrote:[color=green][color=darkred]
> >> > One potentially good function to run them through is strip_tags.
> >>
> >> What would that accomplish?[/color]
> >
> > The removal of various destructive things which one could bury in a tag
> > which would then be interpreted by an e-mail application capable of
> > rendering HTML. For example, an img tag which could result in the
> > downloading of unwanted images.
> >
> > Seems like a good idea, but you seem to feel it would be pointless? Why?[/color]
>
> My MUA already provides this protection and AFAIK any decend MUA does
> that. Added bonus is that I can still tell it not to "protect me", and
> thus show the images when I want it to.
>[color=green][color=darkred]
> >> A good MUA shouldn't trust the content of any
> >> mail (unless the users tells it to ofcourse).[/color]
> >
> > So, then, if you wanted to allow a user to enter some text into the body
> > of a message, what would you do to protect the recipient of that
> > message?[/color]
>
> Advise them a decent MUA, and fitler out html messages. My smapfilter is
> trained to tag htmlonly mail as spam (except when explicitly
> whitelisted), shows text/plain by default and
> will not fetch external links by default.[/color]
Unfortunately, your latest comments are clearly entirely irrelevant to
the discussion which is what useful things can be done to process text
sent to the body and subject parameters of the mail() function to
prevent anything annoying/destructive from being sent to the recipient.
If you have any comments related to the topic of this thread, please let
me know.
For those who may be interested, in a simultaneous discussion which took
place elsewhere, one other option was presents which would be to run the
text through the htmlentities function.
Like strip_tags, this would prevent any annoying/destructive html from
being rendered and have the addition benefit of knowing whether or not
someone attempted to send something that was annoying/destructive.
However, I, personally, will likely stick with strip_tags. Although,
this function could remove useful text, it would also not force the
recipient to try to parse something not particularly human readable.
It would seem the sending of things that strip_tags or htmlentities
would stop is the only thing that one would need to be concerned with. |