Em 06-02-2013 14:00, Nikolai Weibull escreveu:
> On Wed, Feb 6, 2013 at 2:37 PM, rosenfeld (Rodrigo Rosenfeld Rosas)
> <rr.rosas / gmail.com>  wrote:
>
>> Lots of Denial-of-Service security vulnerabilities exploited in Ruby programs rely on symbols not being collected by garbage collector.
> I”Ēm out of the loop on this one.  I”Ēm assuming that this occurs when a
> program creates a lot of symbols based on user input.  If that”Ēs the
> attack vector, shouldn”Ēt that be fixed instead of letting the GC
> collect Symbols, which, as has already been stated, seems very hard to
> do correctly, if at all?

Nikolai, it is possible to fix the applications/frameworks against this 
kind of attack, but people will keep finding new ways of doing that and 
the fact that symbols do not get their memory reclaimed back makes some 
decisions a bit complicate to decide against.

For instance, YAML#safe_load should allow restoring symbols? If symbols 
are collected by the GC, then it is safe for safe_load to convert 
symbols from YAML input. Otherwise, it is not safe and you wouldn't be 
able to load symbols from YAML input using safe_load. Do you see?