Program: CWE-79
Project: CVE-2016-10215
Buggy source:
{
    "type": "extension",
    "id": "com.fastspot.form-builder",
    "version": "1.1",
    "revision": 21,
    "compatibility": "4.2+",
    "title": "Form Builder",
    "description": "An easy to use form builder allowing the administrative users to easily add fields to a form that stores entries in the database and sends out emails. Also supports paid forms.",
    "keywords": [
        "forms",
        "emails",
        "submissions",
        "form"
    ],
    "author": {
        "name": "Tim Buckingham",
        "url": "http://www.fastspot.com",
        "email": "tim@fastspot.com"
    },
    "licenses": {
        "LGPL v3": "http://opensource.org/licenses/LGPL-3.0"
    },
    "components": {
        "module_groups": [],
        "modules": [
            {
                "id": "4",
                "group": null,
                "name": "Form Builder",
                "route": "com.fastspot.form-builder*btx-form-builder",
                "class": "BTXFormBuilder",
                "icon": "form",
                "gbp": {
                    "name": "",
                    "table": "",
                    "other_table": ""
                },
                "position": "0",
                "extension": "com.fastspot.form-builder",
                "actions": [
                    {
                        "id": "15",
                        "module": "4",
                        "name": "View Forms",
                        "route": "",
                        "in_nav": "on",
                        "form": null,
                        "view": "5",
                        "report": null,
                        "class": "list",
                        "level": "0",
                        "position": "3"
                    },
                    {
                        "id": "16",
                        "module": "4",
                        "name": "Add Form",
                        "route": "add",
                        "in_nav": "on",
                        "form": null,
                        "view": null,
                        "report": null,
                        "class": "add",
                        "level": "0",
                        "position": "2"
                    },
                    {
                        "id": "17",
                        "module": "4",
                        "name": "Settings",
                        "route": "settings",
                        "in_nav": "on",
                        "form": null,
                        "view": null,
                        "report": null,
                        "class": "server",
                        "level": "0",
                        "position": "1"
                    }
                ],
                "views": [
                    {
                        "id": "5",
                        "module": "4",
                        "title": "Forms",
                        "description": "",
                        "type": "searchable",
                        "table": "btx_form_builder_forms",
                        "fields": {
                            "title": {
                                "title": "Title",
                                "parser": "",
                                "width": 222,
                                "numeric": false
                            },
                            "entries": {
                                "title": "Entries",
                                "parser": "",
                                "width": 222,
                                "numeric": true
                            },
                            "last_entry": {
                                "title": "Last Entry",
                                "parser": "if ($value) { $value = date(\"F j @ g:ia\",strtotime($value)); }",
                                "width": 222,
                                "numeric": false
                            }
                        },
                        "options": {
                            "sort_column": "title",
                            "sort_direction": "ASC",
                            "per_page": "15",
                            "filter": ""
                        },
                        "actions": {
                            "entries": "{\"name\":\"Entries\",\"class\":\"icon_view\",\"route\":\"entries\",\"function\":\"\"}",
                            "export": "{\"name\":\"Export\",\"class\":\"icon_export\",\"route\":\"export\",\"function\":\"\"}",
                            "edit": "on",
                            "delete": "on"
                        },
                        "preview_url": "",
                        "related_form": null
                    }
                ],
                "forms": [],
                "embed_forms": [],
                "reports": []
            }
        ],
        "templates": [
            {
                "id": "com.fastspot.form-builder*btx-form-builder",
                "name": "Form Builder",
                "routed": "on",
                "resources": [
                    {
                        "id": "page_header",
                        "title": "Page Header",
                        "subtitle": "",
                        "type": "text",
                        "options": []
                    },
                    {
                        "id": "page_content",
                        "title": "Page Content",
                        "subtitle": "",
                        "type": "html",
                        "options": []
                    },
                    {
                        "id": "form",
                        "title": "Form",
                        "subtitle": "",
                        "type": "com.fastspot.form-builder*form-builder-picker",
                        "options": {
                            "list_type": "db",
                            "allow-empty": "No",
                            "pop-table": "btx_form_builder_forms",
                            "pop-description": "title",
                            "pop-sort": "`title` ASC"
                        }
                    },
                    {
                        "id": "emails",
                        "title": "Email Addresses",
                        "subtitle": "(to send submissions notifications to \u2014 separate with commas)",
                        "type": "textarea",
                        "options": []
                    },
                    {
                        "id": "thank_you_page_header",
                        "title": "Thank You Page Header",
                        "subtitle": "",
                        "type": "text",
                        "options": []
                    },
                    {
                        "id": "thank_you_page_content",
                        "title": "Thank You Page Content",
                        "subtitle": "",
                        "type": "html",
                        "options": []
                    }
                ],
                "module": "0",
                "level": "0",
                "position": "1",
                "extension": "com.fastspot.form-builder"
            }
        ],
        "callouts": [],
        "settings": [],
        "feeds": [],
        "field_types": [
            {
                "id": "com.fastspot.form-builder*form-builder-picker",
                "name": "Form Builder Form",
                "use_cases": {
                    "templates": "on",
                    "modules": "on",
                    "callouts": "on",
                    "settings": "on"
                },
                "self_draw": "on",
                "extension": "com.fastspot.form-builder"
            }
        ],
        "tables": {
            "btx_form_builder_entries": "CREATE TABLE `btx_form_builder_entries` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `form` int(11) NOT NULL,   `data` longtext NOT NULL,   `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',   PRIMARY KEY (`id`),   KEY `form` (`form`),    FOREIGN KEY (`form`) REFERENCES `btx_form_builder_forms` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
            "btx_form_builder_fields": "CREATE TABLE `btx_form_builder_fields` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `form` int(11) NOT NULL,   `column` int(11) NOT NULL,   `alignment` char(5) NOT NULL,   `type` varchar(255) NOT NULL DEFAULT '',   `data` longtext NOT NULL,   `position` int(11) NOT NULL,   `tester` int(11) DEFAULT NULL,   PRIMARY KEY (`id`),   KEY `form` (`form`),   KEY `column` (`column`),   KEY `position` (`position`),    FOREIGN KEY (`form`) REFERENCES `btx_form_builder_forms` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
            "btx_form_builder_forms": "CREATE TABLE `btx_form_builder_forms` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `title` varchar(255) NOT NULL DEFAULT '',   `paid` char(2) NOT NULL DEFAULT '',   `base_price` float NOT NULL,   `early_bird_base_price` float NOT NULL,   `early_bird_date` datetime DEFAULT NULL,   `total_collected` float NOT NULL,   `entries` int(11) NOT NULL,   `limit_entries` char(2) NOT NULL DEFAULT '',   `max_entries` int(11) NOT NULL,   `last_entry` datetime DEFAULT NULL,   PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8"
        }
    },
    "sql_revisions": {
        "8": [
            "ALTER TABLE `btx_form_builder_fields` ADD COLUMN `tester` int(11) NULL DEFAULT NULL AFTER `position`"
        ]
    }
}

Fixed version (ground truth):
{
    "type": "extension",
    "id": "com.fastspot.form-builder",
    "version": "1.2",
    "revision": 22,
    "compatibility": "4.2+",
    "title": "Form Builder",
    "description": "An easy to use form builder allowing the administrative users to easily add fields to a form that stores entries in the database and sends out emails. Also supports paid forms.",
    "keywords": [
        "forms",
        "emails",
        "submissions",
        "form"
    ],
    "author": {
        "name": "Tim Buckingham",
        "url": "http://www.fastspot.com",
        "email": "tim@fastspot.com"
    },
    "licenses": {
        "LGPL v3": "http://opensource.org/licenses/LGPL-3.0"
    },
    "components": {
        "module_groups": [],
        "modules": [
            {
                "id": "4",
                "group": null,
                "name": "Form Builder",
                "route": "com.fastspot.form-builder*btx-form-builder",
                "class": "BTXFormBuilder",
                "icon": "form",
                "gbp": {
                    "name": "",
                    "table": "",
                    "other_table": ""
                },
                "position": "0",
                "extension": "com.fastspot.form-builder",
                "actions": [
                    {
                        "id": "15",
                        "module": "4",
                        "name": "View Forms",
                        "route": "",
                        "in_nav": "on",
                        "form": null,
                        "view": "5",
                        "report": null,
                        "class": "list",
                        "level": "0",
                        "position": "3"
                    },
                    {
                        "id": "16",
                        "module": "4",
                        "name": "Add Form",
                        "route": "add",
                        "in_nav": "on",
                        "form": null,
                        "view": null,
                        "report": null,
                        "class": "add",
                        "level": "0",
                        "position": "2"
                    },
                    {
                        "id": "17",
                        "module": "4",
                        "name": "Settings",
                        "route": "settings",
                        "in_nav": "on",
                        "form": null,
                        "view": null,
                        "report": null,
                        "class": "server",
                        "level": "2",
                        "position": "1"
                    }
                ],
                "views": [
                    {
                        "id": "5",
                        "module": "4",
                        "title": "Forms",
                        "description": "",
                        "type": "searchable",
                        "table": "btx_form_builder_forms",
                        "fields": {
                            "title": {
                                "title": "Title",
                                "parser": "",
                                "width": 222,
                                "numeric": false
                            },
                            "entries": {
                                "title": "Entries",
                                "parser": "",
                                "width": 222,
                                "numeric": true
                            },
                            "last_entry": {
                                "title": "Last Entry",
                                "parser": "if ($value) { $value = date(\"F j @ g:ia\",strtotime($value)); }",
                                "width": 222,
                                "numeric": false
                            }
                        },
                        "options": {
                            "sort_column": "title",
                            "sort_direction": "ASC",
                            "per_page": "15",
                            "filter": ""
                        },
                        "actions": {
                            "entries": "{\"name\":\"Entries\",\"class\":\"icon_view\",\"route\":\"entries\",\"function\":\"\"}",
                            "export": "{\"name\":\"Export\",\"class\":\"icon_export\",\"route\":\"export\",\"function\":\"\"}",
                            "edit": "on",
                            "delete": "on"
                        },
                        "preview_url": "",
                        "related_form": null
                    }
                ],
                "forms": [],
                "embed_forms": [],
                "reports": []
            }
        ],
        "templates": [
            {
                "id": "com.fastspot.form-builder*btx-form-builder",
                "name": "Form Builder",
                "routed": "on",
                "resources": [
                    {
                        "id": "page_header",
                        "title": "Page Header",
                        "subtitle": "",
                        "type": "text",
                        "options": []
                    },
                    {
                        "id": "page_content",
                        "title": "Page Content",
                        "subtitle": "",
                        "type": "html",
                        "options": []
                    },
                    {
                        "id": "form",
                        "title": "Form",
                        "subtitle": "",
                        "type": "com.fastspot.form-builder*form-builder-picker",
                        "options": {
                            "list_type": "db",
                            "allow-empty": "No",
                            "pop-table": "btx_form_builder_forms",
                            "pop-description": "title",
                            "pop-sort": "`title` ASC"
                        }
                    },
                    {
                        "id": "emails",
                        "title": "Email Addresses",
                        "subtitle": "(to send submissions notifications to \u2014 separate with commas)",
                        "type": "textarea",
                        "options": []
                    },
                    {
                        "id": "thank_you_page_header",
                        "title": "Thank You Page Header",
                        "subtitle": "",
                        "type": "text",
                        "options": []
                    },
                    {
                        "id": "thank_you_page_content",
                        "title": "Thank You Page Content",
                        "subtitle": "",
                        "type": "html",
                        "options": []
                    }
                ],
                "module": "0",
                "level": "0",
                "position": "1",
                "extension": "com.fastspot.form-builder"
            }
        ],
        "callouts": [],
        "settings": [],
        "feeds": [],
        "field_types": [
            {
                "id": "com.fastspot.form-builder*form-builder-picker",
                "name": "Form Builder Form",
                "use_cases": {
                    "templates": "on",
                    "modules": "on",
                    "callouts": "on",
                    "settings": "on"
                },
                "self_draw": "on",
                "extension": "com.fastspot.form-builder"
            }
        ],
        "tables": {
            "btx_form_builder_entries": "CREATE TABLE `btx_form_builder_entries` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `form` int(11) NOT NULL,   `data` longtext NOT NULL,   `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',   PRIMARY KEY (`id`),   KEY `form` (`form`),    FOREIGN KEY (`form`) REFERENCES `btx_form_builder_forms` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
            "btx_form_builder_fields": "CREATE TABLE `btx_form_builder_fields` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `form` int(11) NOT NULL,   `column` int(11) NOT NULL,   `alignment` char(5) NOT NULL,   `type` varchar(255) NOT NULL DEFAULT '',   `data` longtext NOT NULL,   `position` int(11) NOT NULL,   `tester` int(11) DEFAULT NULL,   PRIMARY KEY (`id`),   KEY `form` (`form`),   KEY `column` (`column`),   KEY `position` (`position`),    FOREIGN KEY (`form`) REFERENCES `btx_form_builder_forms` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
            "btx_form_builder_forms": "CREATE TABLE `btx_form_builder_forms` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `title` varchar(255) NOT NULL DEFAULT '',   `paid` char(2) NOT NULL DEFAULT '',   `base_price` float NOT NULL,   `early_bird_base_price` float NOT NULL,   `early_bird_date` datetime DEFAULT NULL,   `total_collected` float NOT NULL,   `entries` int(11) NOT NULL,   `limit_entries` char(2) NOT NULL DEFAULT '',   `max_entries` int(11) NOT NULL,   `last_entry` datetime DEFAULT NULL,   PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8"
        }
    },
    "sql_revisions": {
        "8": [
            "ALTER TABLE `btx_form_builder_fields` ADD COLUMN `tester` int(11) NULL DEFAULT NULL AFTER `position`"
        ]
    }
}