Instruction
stringclasses
1 value
Input
stringlengths
79
33k
Response
stringlengths
106
9.29k
__index_level_0__
int64
0
2.83k
Find vulnerabilities in this ABAP code snippet.
```abap CLASS ZCL_ZOSQL_DB_LAYER IMPLEMENTATION. method ZIF_ZOSQL_DB_LAYER~COMMIT. IF iv_wait = abap_true. COMMIT WORK AND WAIT. ELSE. COMMIT WORK. ENDIF. endmethod. method ZIF_ZOSQL_DB_LAYER~DELETE. DATA: lv_table_name TYPE string, lv_where TYPE ...
I found vulnerabilities in the line: ```abap DELETE (lv_table_name) FROM TABLE <lt_itab_for_db_operation>. ``` Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. ```abap INSERT (lv_table_name) FROM TABLE <lt_itab_for_db_operation>. ``` Explanation: Modify only own DB tables | Potential ...
2,780
Find vulnerabilities in this ABAP code snippet.
```abap method wait_for_free_dialog. "hardcoded 3 on purpose. Less than that and systems get weird. data num_free_dia_wps type i. data num_wps type i. constants opcode_wp_get_info type x value 25. call 'ThWpInfo' id 'OPCODE' field opcode_wp_get_info id 'WP' ...
I found vulnerabilities in the line: ```abap constants opcode_wp_get_info type x value 25. call 'ThWpInfo' * <-- There is a problem here id 'OPCODE' field opcode_wp_get_info id 'WP' field num_wps ``` Explanation: Potential dangerous statement KERNEL CALL.
2,792
Find vulnerabilities in this ABAP code snippet.
```abap while num_free_dia_wps < 3. "can lead to starvation if server usage is too high for too long wait up to gc_wait_period_interval seconds. call 'ThWpInfo' id 'OPCODE' field opcode_wp_get_info id 'WP' field num_wps id 'FREE_DIAWP' field num_free_dia_wps. endwhile. ```
I found vulnerabilities in the line: ```abap wait up to gc_wait_period_interval seconds. call 'ThWpInfo' * <-- There is a problem here id 'OPCODE' field opcode_wp_get_info ``` Explanation: Potential dangerous statement KERNEL CALL.
2,793
Find vulnerabilities in this ABAP code snippet.
```abap IF fw_display = space. GENERATE SUBROUTINE POOL lt_code_string NAME fw_program. ELSE. ```
I found vulnerabilities in the line: ```abap ENDIF. IF fw_display = space. GENERATE SUBROUTINE POOL lt_code_string NAME fw_program. * <-- There is a problem here ELSE. IF lw_mess IS NOT INITIAL. lw_explicit = lw_line. ``` Explanation: Potential dangerous statement GENERATE SUBROUTINE. ```abap ENDIF. IF fw_displ...
2,794
Find vulnerabilities in this ABAP code snippet.
```abap FORM query_process_native USING fw_command TYPE string. DATA : lw_lines TYPE i, lw_sql_code TYPE i, lw_sql_msg(255) TYPE c, lw_row_num TYPE i, lw_command(255) TYPE c, lw_msg TYPE string, lw_timestart TYPE timestampl, ...
I found vulnerabilities in the line: ```abap CALL 'C_DB_EXECUTE' ``` Explanation: Potential dangerous statement KERNEL CALL.
2,795
Find vulnerabilities in this ABAP code snippet.
```abap FORM ddic_add_tree_zspro. DATA : lo_zspro TYPE REF TO data, ls_node LIKE LINE OF s_tab_active-t_node_ddic, ls_item LIKE LINE OF s_tab_active-t_item_ddic, lw_nodekey TYPE tv_nodekey, BEGIN OF ls_ddic_fields, tabname TYPE dd03l-tabname, ...
I found vulnerabilities in the line: ```abap SELECT * FROM (lc_zspro) ``` Explanation: Potential dangerous statement Dynamic SQL.
2,796
Find vulnerabilities in this ABAP code snippet.
```abap TRY. SELECT COUNT(*) UP TO 1 ROWS FROM (table). CATCH cx_sy_dynamic_osql_syntax cx_sy_dynamic_osql_semantics INTO lx. MESSAGE lx TYPE 'S' DISPLAY LIKE 'E'. RETURN. ENDTRY. ```
I found vulnerabilities in the line: ```abap SELECT COUNT(*) UP TO 1 ROWS FROM (table). ``` Explanation: Potential dangerous statement Dynamic SQL.
2,797
Find vulnerabilities in this ABAP code snippet.
```abap TRY. SELECT * UP TO @rows ROWS FROM (table) INTO TABLE @<lt_data> ORDER BY PRIMARY KEY. CATCH cx_sy_dynamic_osql_syntax cx_sy_dynamic_osql_semantics INTO lx. MESSAGE lx TYPE 'S' DISPLAY LIKE 'E'. RETURN. ENDTRY. ```
I found vulnerabilities in the line: ```abap SELECT * UP TO @rows ROWS ``` Explanation: Potential dangerous statement Dynamic SQL.
2,798
Find vulnerabilities in this ABAP code snippet.
```abap CLASS zcl_dbbr_sql_selection IMPLEMENTATION. METHOD create. rr_instance = NEW zcl_dbbr_sql_selection( ). rr_instance->mt_select = it_select. rr_instance->mt_from = it_from. rr_instance->mt_having = it_having. rr_instance->mt_where = it_where. rr_instance->mt_ord...
I found vulnerabilities in the line: ```abap SELECT COUNT( * ) ``` Explanation: Potential dangerous statement Dynamic SQL. Suggested fix: ```abap CLASS zcl_dbbr_sql_selection IMPLEMENTATION. METHOD create. ro_instance = NEW zcl_dbbr_sql_selection( ). ro_instance->mt_select = it_select. ro_instance->mt_f...
2,801
Find vulnerabilities in this ABAP code snippet.
```abap CLASS zcl_art_shade_rec IMPLEMENTATION. METHOD constructor. IF i_world IS SUPPLIED. ASSERT i_world IS BOUND. hit_an_object = abap_false. CREATE OBJECT local_hit_point. CREATE OBJECT normal. CREATE OBJECT color EXPORTING i_color = zcl_art_rgb_c...
I found vulnerabilities in the line: ```abap SYSTEM-CALL OBJMGR CLONE i_shade_rec TO me. ``` Explanation: Potential dangerous statement SYSTEM-CALL. Suggested fix: ```abap CLASS ZCL_ART_SHADE_REC IMPLEMENTATION. METHOD new_copy. ASSERT i_shade_rec IS BOUND. r_instance = NEW #( ). r_instance->hit_an_object...
2,802
Find vulnerabilities in this ABAP code snippet.
```abap METHOD determine_tagged_object_count. DATA: where TYPE TABLE OF string. LOOP AT object_refs ASSIGNING FIELD-SYMBOL(<obj_ref>). DATA(operator) = COND #( WHEN sy-tabix <> 1 THEN ` OR ` ELSE `` ). where = VALUE #( BASE where ( |{ operator }( OBJECT_TYPE = { cl_abap_dyn_prg=>quote( <obj_r...
I found vulnerabilities in the line: ```abap SELECT tag_id, COUNT( * ) AS count ``` Explanation: Potential dangerous statement Dynamic SQL. Suggested fix: ```abap METHOD determine_tagged_object_count. tagged_obj_counts = tags_dac->get_tagged_obj_count( object_refs = CORRESPONDING #( object_refs ) ). ENDMETHOD. ```
2,803
Find vulnerabilities in this ABAP code snippet.
```abap WHILE child_tags IS NOT INITIAL. SELECT (fields) FROM zabaptags_tags FOR ALL ENTRIES IN @child_tags WHERE parent_tag_id = @child_tags-tag_id INTO CORRESPONDING FIELDS OF TABLE @new_child_tags. tags = CORRESPONDING #( BASE ( tags ) new_child_tags ). child_tags = CORRESPONDING #( ne...
I found vulnerabilities in the line: ```abap SELECT (fields) ``` Explanation: Potential dangerous statement Dynamic SQL. Suggested fix: ```abap WHILE child_tags IS NOT INITIAL. new_child_tags = zcl_abaptags_tags_dac=>get_instance( )->find_tags( columns = columns parent_tag_id_range = VALUE #( FOR ...
2,804
Find vulnerabilities in this ABAP code snippet.
```abap METHOD deserialize_program. DATA: lv_exists TYPE abap_bool, lv_progname TYPE reposrc-progname, ls_tpool LIKE LINE OF it_tpool, lv_title TYPE rglif-title, ls_progdir_new TYPE progdir. FIELD-SYMBOLS: <lg_any> TYPE any. CALL FUNCTION 'RS_CORR...
I found vulnerabilities in the line: ```abap ELSE. INSERT REPORT is_progdir-name * <-- There is a problem here FROM it_source ``` Explanation: Potential dangerous statement INSERT REPORT. Suggested fix: ```abap METHOD deserialize_program. DATA: lv_exists TYPE abap_bool, lt_empty_src LIKE it_sourc...
2,805
Find vulnerabilities in this ABAP code snippet.
```abap method ADD_TABLE_TO_BUNDLE. FIELD-SYMBOLS: <con> TYPE STANDARD TABLE. IF _table-fake_table IS INITIAL. _table-fake_table = _table-source_table. ENDIF. IF line_exists( cluster_objects[ name = _table-fake_table ] ). RAISE EXCEPTION TYPE zcx_export_table_duplicate EXPORTING ...
I found vulnerabilities in the line: ```abap SELECT * FROM (_table-source_table) INTO TABLE @<con> ``` Explanation: Potential dangerous statement Dynamic SQL. Suggested fix: ```abap METHOD add_table_to_bundle. FIELD-SYMBOLS: <con> TYPE STANDARD TABLE. IF _table-fake_table IS INITIAL. _table-fake_table = _table-...
2,806
Find vulnerabilities in this ABAP code snippet.
```abap TRY. _table-tdc_parameter_name = create_parameter( _table-fake_table ). CREATE DATA content TYPE STANDARD TABLE OF (_table-source_table). ASSIGN content->* TO <con>. SELECT * FROM (_table-source_table) INTO TABLE @<con> WHERE (_table-where_restriction). _table-is_initial = xs...
I found vulnerabilities in the line: ```abap SELECT * FROM (_table-source_table) INTO TABLE @<con> ``` Explanation: Potential dangerous statement Dynamic SQL. Suggested fix: ```abap TRY. _table-tdc_parameter_name = create_parameter( _table-fake_table ). CREATE DATA content TYPE STANDARD TABLE OF (_table-fake_ta...
2,807
Find vulnerabilities in this ABAP code snippet.
```abap LOOP AT cluster_objects REFERENCE INTO DATA(object). ASSIGN object->*-value->* TO <con>. READ TABLE table_list REFERENCE INTO DATA(_table) WITH KEY fake_table = CONV tabname( object->*-name ). ASSERT FIELDS object->*-name CONDITION sy-subrc = 0. DELETE FROM (object->*-name) WHERE (_table-...
I found vulnerabilities in the line: ```abap DELETE FROM (object->*-name) WHERE (_table->*-where_restriction). ``` Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. Suggested fix: ```abap LOOP AT cluster_objects REFERENCE INTO DATA(object). ASSIGN object->*-value->* TO <con>. READ ...
2,808
Find vulnerabilities in this ABAP code snippet.
```abap LOOP AT table_list REFERENCE INTO DATA(table). CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table). ASSIGN content->* TO <con>. tdc->get_value( EXPORTING i_param_name = get_tdc_parameter_name( table->* ) i_variant_name = variant CHANGING e_param_value = <con> ). DELETE FRO...
I found vulnerabilities in the line: ```abap DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction). ``` Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. Suggested fix: ```abap LOOP AT table_list REFERENCE INTO DATA(table). CREATE DATA content TYPE STANDARD TABLE OF (t...
2,809
Find vulnerabilities in this ABAP code snippet.
```abap CLASS Y_CHECK_DB_ACCESS_IN_UT IMPLEMENTATION. METHOD constructor. super->constructor( ). settings-pseudo_comment = '"#EC DB_ACCESS_UT' ##NO_TEXT. settings-disable_threshold_selection = abap_true. settings-disable_on_prodcode_selection = abap_true. settings-disable_on_testcode_s...
I found vulnerabilities in the line: ```abap SELECT SINGLE * FROM (checked_object) INTO <table_structure>. ``` Explanation: Potential dangerous statement Dynamic SQL. Suggested fix: ```abap CLASS y_check_db_access_in_ut IMPLEMENTATION. METHOD constructor. super->constructor( ). settings-pseudo_comment = ' ...
2,814
Find vulnerabilities in this ABAP code snippet.
```abap REPORT zcute_main. PARAMETERS p_table TYPE tabname16 DEFAULT 'ZCUTE_TEST'. CLASS lcl_cute_source_information DEFINITION. PUBLIC SECTION. CLASS-METHODS get_instance IMPORTING source TYPE tabname16 RETURNING VALUE(instance) TYPE REF TO lcl_cute_source_inf...
I found vulnerabilities in the line: ```abap SELECT * FROM (lif_cute~source_information->header-tabname) ``` Explanation: Potential dangerous statement Dynamic SQL. ```abap MODIFY (lif_cute~source_information->header-tabname) ``` Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. Sugges...
2,816
Find vulnerabilities in this ABAP code snippet.
```abap class ZCL_ABAPGIT_USER_EXIT definition public final create public . public section. interfaces ZIF_ABAPGIT_EXIT . protected section. private section. ENDCLASS. CLASS ZCL_ABAPGIT_USER_EXIT IMPLEMENTATION. method ZIF_ABAPGIT_EXIT~ADJUST_DISPLAY_COMMIT_URL. return. end...
I found vulnerabilities in the line: ```abap select * * <-- There is a problem here from (lc_tabname) ``` Explanation: Potential dangerous statement Dynamic SQL. Suggested fix: ```abap class zcl_abapgit_user_exit definition public final create public . public section. interfaces zif_abapgit_exit . prote...
2,817
Find vulnerabilities in this ABAP code snippet.
```abap METHOD insert_program. CALL FUNCTION 'RPY_PROGRAM_INSERT' EXPORTING development_class = iv_package program_name = is_progdir-name program_type = is_progdir-subc title_string = iv_title save_inactive = 'I' suppress_dialog = abap_true T...
I found vulnerabilities in the line: ```abap INSERT REPORT is_progdir-name * <-- There is a problem here FROM it_source ``` Explanation: Potential dangerous statement INSERT REPORT. ```abap PROGRAM TYPE is_progdir-subc. INSERT REPORT is_progdir-name * <-- There is a problem here FROM it_source ``` Explanation: Poten...
2,818
Find vulnerabilities in this ABAP code snippet.
```abap METHOD create_report. INSERT REPORT iv_program FROM it_source EXTENSION TYPE iv_extension STATE iv_version PROGRAM TYPE iv_program_type. ASSERT sy-subrc = 0. ENDMETHOD. ```
I found vulnerabilities in the line: ```abap INSERT REPORT iv_program FROM it_source EXTENSION TYPE iv_extension STATE iv_version PROGRAM TYPE iv_program_type. ``` Explanation: Potential dangerous statement INSERT REPORT. Suggested fix: ```abap METHOD create_report. zcl_abapinst_factory=>get_sap_report( )->insert_rep...
2,819
Find vulnerabilities in this ABAP code snippet.
```abap METHOD delete_report. DELETE REPORT iv_program ##SUBRC_OK. ENDMETHOD. ```
I found vulnerabilities in the line: ```abap DELETE REPORT iv_program ##SUBRC_OK. ``` Explanation: Potential dangerous statement DELETE REPORT. Suggested fix: ```abap METHOD delete_report. zcl_abapinst_factory=>get_sap_report( )->delete_report( iv_program ). ENDMETHOD. ```
2,820
Find vulnerabilities in this ABAP code snippet.
```abap METHOD update_report. DATA: lt_old TYPE string_table. READ REPORT iv_program INTO lt_old. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Fatal error. Include { iv_program } should have been created previously!| ). ENDIF. IF lt_old <> it_source. INSERT REPORT iv_program FROM it_s...
I found vulnerabilities in the line: ```abap INSERT REPORT iv_program FROM it_source. ``` Explanation: Potential dangerous statement INSERT REPORT. ```abap INSERT REPORT iv_program FROM it_source. ``` Explanation: Potential dangerous statement INSERT REPORT. Suggested fix: ```abap METHOD update_report. DATA lv_type T...
2,821
Find vulnerabilities in this ABAP code snippet.
```abap METHOD deserialize_functions. DATA: lv_include TYPE rs38l-include, lv_area TYPE rs38l-area, lv_group TYPE rs38l-area, lv_namespace TYPE rs38l-namespace, lt_source TYPE TABLE OF abaptxt255, lv_msg TYPE string, lx_error TYPE REF TO...
I found vulnerabilities in the line: ```abap INSERT REPORT lv_include FROM lt_source. ``` Explanation: Potential dangerous statement INSERT REPORT. Suggested fix: ```abap METHOD deserialize_functions. DATA: lv_include TYPE rs38l-include, lv_area TYPE rs38l-area, lv_group TYPE rs38l-area, ...
2,822
Find vulnerabilities in this ABAP code snippet.
```abap METHOD deserialize_with_ext. " Special treatment for extensions " If the program name exceeds 30 characters it is not a usual ABAP program but might be " some extension, which requires the internal addition EXTENSION TYPE " https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm?file=...
I found vulnerabilities in the line: ```abap INSERT REPORT is_progdir-name ``` Explanation: Potential dangerous statement INSERT REPORT. Suggested fix: ```abap METHOD deserialize_with_ext. zcl_abapinst_factory=>get_sap_report( )->insert_report( iv_name = is_progdir-name iv_package = iv_p...
2,823
Find vulnerabilities in this ABAP code snippet.
```abap CLASS lcl_app IMPLEMENTATION. METHOD main. DATA(app) = NEW lcl_app( ). app->main_2( ). ENDMETHOD. METHOD main_2. DATA shrinker TYPE REF TO zcl_shrinker. DATA(include_does_not_exist) = CONV string( 'Include &1 does not exist. Create it manually as empty.'(001) ). ...
I found vulnerabilities in the line: ```abap INSERT REPORT p_def FROM abap_code-def_abap_source_code DIRECTORY ENTRY trdir_def. ``` Explanation: Potential dangerous statement INSERT REPORT. Suggested fix: ```abap CLASS lcl_app IMPLEMENTATION. METHOD main. DATA(app) = NEW lcl_app( ). app->main_2( ). ENDMETHO...
2,824
Find vulnerabilities in this ABAP code snippet.
```abap CLASS zcl_zabap_table_edit_tab_data IMPLEMENTATION. METHOD constructor. config = configuration. table-fields = NEW #( table_name = config-table_name ). "TODO as interface table-locker = NEW #( table_name = config-table_name ). "TODO as interface table-comparator = NEW #( table_n...
I found vulnerabilities in the line: ```abap CALL 'GET_PARAM_TCOD' ID 'PTCOD' FIELD original_tcode. ``` Explanation: Potential dangerous statement KERNEL CALL. Suggested fix: ```abap CLASS zcl_zabap_table_edit_tab_data IMPLEMENTATION. METHOD constructor. config = configuration. table-fields = NEW #( table...
2,825
Find vulnerabilities in this ABAP code snippet.
```abap CLASS zcl_translatable_program IMPLEMENTATION. METHOD constructor. program_name = program. ENDMETHOD. METHOD zif_translatable~read_language. DATA textpool TYPE STANDARD TABLE OF textpool WITH EMPTY KEY. READ TEXTPOOL program_name INTO textpool LANGUAGE sap_lang. LOOP AT textpool...
I found vulnerabilities in the line: ```abap INSERT TEXTPOOL program_name FROM textpool LANGUAGE sap_lang. ``` Explanation: Potential dangerous statement INSERT TEXTPOOL. Suggested fix: ```abap CLASS zcl_translatable_program IMPLEMENTATION. METHOD constructor. zif_translatable~object_name = program. zif_trans...
2,826
Find vulnerabilities in this ABAP code snippet.
```abap CLASS zcl_translatable_menu_el IMPLEMENTATION. METHOD constructor. zif_translatable~object_name = program. zif_translatable~object_type = zcl_translation_globals=>c_object_type-program. sub_type = zcl_translation_globals=>c_subcomponent-menu_texts. ENDMETHOD. METHOD zif_translatable~re...
I found vulnerabilities in the line: ```abap MODIFY lxe_log FROM TABLE @lxe_log_table. ``` Explanation: Modify only own DB tables. Suggested fix: ```abap CLASS ZCL_TRANSLATABLE_MENU_EL IMPLEMENTATION. METHOD constructor. zif_translatable~object_name = program. zif_translatable~object_type = zcl_translation_gl...
2,827
Find vulnerabilities in this ABAP code snippet.
```abap method _EXECUTE_DELETE. IF iv_where IS NOT INITIAL. DELETE FROM (iv_table_name) WHERE (iv_where). ELSE. DELETE FROM (iv_table_name). ENDIF. rv_subrc = sy-subrc. endmethod. ```
I found vulnerabilities in the line: ```abap DELETE FROM (iv_table_name) ``` Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. ```abap DELETE FROM (iv_table_name). ``` Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. Suggested fix: ```abap METHOD _exe...
2,828
Find vulnerabilities in this ABAP code snippet.
```abap METHOD _execute_select. DATA: lv_order_by_primary_key TYPE abap_bool. lv_order_by_primary_key = _if_order_by_primary_key( iv_order_by ). IF iv_new_syntax = abap_true. " Dynamic call for backward compatibility with older versions CALL METHOD ('ZCL_ZOSQL_UTILS_740')=>('EXECUTE_SELECT_74...
I found vulnerabilities in the line: ```abap IF iv_do_into_corresponding = abap_true. SELECT DISTINCT (iv_select) * <-- There is a problem here FROM (iv_from) ``` Explanation: Potential dangerous statement Dynamic SQL. ```abap WHERE (iv_where). ELSE. SELECT DISTINCT (iv_select) * <-- There is a problem here FROM ...
2,829
Find vulnerabilities in this ABAP code snippet.
```abap method _EXECUTE_UPDATE. IF iv_where IS NOT INITIAL. UPDATE (iv_table_name) SET (iv_set_statement) WHERE (iv_where). ELSE. UPDATE (iv_table_name) SET (iv_set_statement). ENDIF. rv_subrc = sy-subrc. endmethod. ```
I found vulnerabilities in the line: ```abap IF iv_where IS NOT INITIAL. UPDATE (iv_table_name) * <-- There is a problem here SET (iv_set_statement) ``` Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. ```abap ELSE. UPDATE (iv_table_name) * <-- There is a problem here SET ...
2,830