mantisbt-plugins / LinkedCustomFields

MantisBT plugin allowing custom fields to be linked, creating linked drop-downs
GNU General Public License v2.0
6 stars 11 forks source link

CVE-2023-49802 : Problem with special characters #10

Closed lampdanny closed 11 months ago

lampdanny commented 1 year ago

Problem: linked fields with special characters (like &) can't be saved Solution: use htmlspecialchars_decode in LinkedCustomFields.API.php

static function getLinkedFieldId( $p_source_field_id ) {

    $t_query = "SELECT target_field_id FROM " . plugin_table( 'data' ) . " WHERE custom_field_id = " . db_param();

    $t_result = db_query( $t_query, array( $p_source_field_id ) );

    if( 0 == db_num_rows( $t_result ) ) {
        return null;
    }

    $t_array = db_fetch_array( $t_result );
    **return htmlspecialchars_decode($t_field_values_js);**
}
dregad commented 1 year ago

Would you be able to submit a pull request ?

lampdanny commented 1 year ago

Would you be able to submit a pull request ?

Probably. New to Github ...

dregad commented 1 year ago

Thanks. Let me know if you need help