2

I have a site where users post comments. Often, those comments have URLs to a video streaming site with URLs in the following format:

enter image description here

My site does not link the latter part comprising @57m58s which leads them to that specific part of the video.

I tried to determine if this URL format is indeed valid by going through the RFC for URL format. I'm also trying to find out if it has ramifications from the security perspective because these are added as comments in the site. (The comments don't allow users to add HTML content).

Is implementing a filter to ensure that the URL is fully linked inclusive of @time valid? Could it be a security concern?

2 Answers2

3

As explained in this SO article, @ is a reserved symbol and should not be used directly in URLs. However, it should work when URL encoded.

Correction: @ is a legal character for the path component, and should work. Nevertheless, if reality disagrees with theory, trying a practical solution isn't a bad idea.

Therefore, a form filter that converts raw @ to %40 might solve your problem.

Foo Bar
  • 243
  • 1
  • 10
  • According to my answer in the linked question, @ can be used directly (i.e., unencoded) in the path. – unor Mar 03 '15 at 15:31
  • Res ipsa loquitur. Raw @ isn't working properly on the asker's site. RFC-compliant percent encoding addresses his concerns. – Foo Bar Mar 03 '15 at 15:36
  • We don’t know why it is not working. Using @ without percent-encoding works perfectly fine for various other sites (including twitter.com). It might be the case that percent-encoding helps the OP in his specific context (which we don’t know yet), but it’s not correct to state that @ "should not be used directly". 2. It is also RFC-compliant not to percent-encode @ in the path.
  • – unor Mar 03 '15 at 15:42