Tinder

Incorrect cache usage may lead to illegal JIDs being constructed.

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0 - Initial Release
  • Component/s: None
  • Labels:
    None
  • Acceptance Test - Add?:
    No

Description

String-prepping a value is a rather expensive operation. The JID implementation uses a cache to store stringprepped values for node, domain and resource identifiers. A value that's stringprepped succesfully will be stored in the cache. Subsequent requests for stringprepping of that value can then be answered from the cache, which offers a significant preformance boost.

The same cache is used to store stringprepped nodes, domains and resources. The Stringprep-operation for nodes, domains and resources is different though. This leads to a problem, where a value (that's valid in the context of one identifier) is succesfully returned from the cache in the context of another identifier, where this value is illegal.

A junit test has been added to verify this bug: org.xmpp.packet.StringPrepCacheTest.

Activity

Hide
Guus der Kinderen added a comment - - edited

Additional caches have been implemented. Now, every portion of a JID is cached in a different cache.

Show
Guus der Kinderen added a comment - - edited Additional caches have been implemented. Now, every portion of a JID is cached in a different cache.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: