GNOME Bugzilla – Bug 727593
JsonGenerator fails to escape object key strings
Last modified: 2014-05-21 09:54:02 UTC
JsonGenerator fails to escape object member name strings. Not only is this flakey, it can lead to SQL injection style vulnerabilities. For example: if (name && name[0] != '\0') { if (pretty) g_string_append_printf (buffer, "\"%s\" : ", name); else g_string_append_printf (buffer, "\"%s\":", name); } In addition json-glib does not support empty key names for objects. It generates invalid JSON when an object member name is an empty string.
Created attachment 276826 [details] [review] generator: Escape Object key names correctly Also fix empty keys, which are now encoded properly.
Review of attachment 276826 [details] [review]: looks good.
Attachment 276826 [details] pushed as 8f4816a - generator: Escape Object key names correctly