Forum Discussion

Mike_Nepomny's avatar
Mike_Nepomny
Icon for Nimbostratus rankNimbostratus
Jan 18, 2012

HTML encode function for iRule

Hi

 

 

I am looking for function/method to perform HTML encoding within iRule. Can I use php or Perl and call it from iRule?

 

 

Thank you.

 

3 Replies

  • Hi Mike,

     

     

    Do you have a lot of HTML you want to encode? Or is it something you can do statically once at iRule load time?

     

     

    I think it would be great to have a native HTML encode function in iRules. You cannot load PHP or Perl in an iRule. But we should be able to come up with some kind of psuedo function to do this.

     

     

    Aaron
  • Hi Aaron,

     

     

    I have iRule that flushes back to user his request. This can be exploited for XSS. That is why I want to HTML encode the request before presenting it back.

     

     

     

    Thank you.

     

  • If it's a static response, you could just HTML encode the content and then use HTTP::respond to send it.

     

     

    Regardless, I think it would be a good feature request. If you're interested, could you open a case with F5 Support on this? Requests for enhancement from customers carry more weight than from me :). If you do, can you reply back with the BZ ID you get?

     

     

    Aaron