in reply to Interpolation of variables in stored HTML
Using a template framework is the right answer. Several good ones have been suggested. You should know, your code as it stands is probably insecure. I am guessing from the snippet that you aren't using strict and that you are doing something like this?
%in = CGI->Vars;
If so—or if the input is coming from users at any stage without being vetted—a malicious URL can be passed to your form and it could do anything from erase or take over your site to hijack other users' accounts. All user input that is displayed as HTML must be HTML encoded: HTML::Entities. Don't save a security "clean-up" pass for last. Have it in mind always: OWASP. Text::Xslate in particular does HTML encoding by default.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Interpolation of variables in stored HTML
by tel2 (Pilgrim) on Nov 04, 2016 at 02:58 UTC | |
by Your Mother (Archbishop) on Nov 04, 2016 at 12:21 UTC | |
by Anonymous Monk on Nov 04, 2016 at 08:51 UTC |