File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -489,6 +489,12 @@ protected function geolocalizzazione()
489489 $ apiKey = setting ('Google Maps API key per Tecnici ' );
490490 $ url = 'https://maps.googleapis.com/maps/api/geocode/json?address= ' .$ indirizzo .'&key= ' .$ apiKey ;
491491
492+ // Validazione URL per prevenire SSRF
493+ $ parsed_url = parse_url ($ url );
494+ if (!isset ($ parsed_url ['host ' ]) || $ parsed_url ['host ' ] !== 'maps.googleapis.com ' ) {
495+ return false ;
496+ }
497+
492498 $ response = file_get_contents ($ url );
493499 $ data = json_decode ($ response , true );
494500
Original file line number Diff line number Diff line change @@ -131,6 +131,12 @@ protected function geolocalizzazione()
131131 $ apiKey = setting ('Google Maps API key per Tecnici ' );
132132 $ url = 'https://maps.googleapis.com/maps/api/geocode/json?address= ' .$ indirizzo .'&key= ' .$ apiKey ;
133133
134+ // Validazione URL per prevenire SSRF
135+ $ parsed_url = parse_url ($ url );
136+ if (!isset ($ parsed_url ['host ' ]) || $ parsed_url ['host ' ] !== 'maps.googleapis.com ' ) {
137+ return false ;
138+ }
139+
134140 $ response = file_get_contents ($ url );
135141 $ data = json_decode ($ response , true );
136142
Original file line number Diff line number Diff line change 3030 'id_plugin ' => $ plugin ,
3131 'name ' => post ('name ' ),
3232 'html_name ' => post ('html_name ' ),
33- 'content ' => $ _POST [ 'content ' ] ,
33+ 'content ' => post ( 'content ' ) ,
3434 'on_add ' => post ('on_add ' ),
3535 'top ' => post ('top ' ),
3636 ], ['id ' => $ id_record ]);
4747 'id_module ' => $ module ,
4848 'id_plugin ' => $ plugin ,
4949 'name ' => post ('name_add ' ),
50- 'content ' => $ _POST [ 'content_add ' ] ,
50+ 'content ' => post ( 'content_add ' ) ,
5151 'html_name ' => secure_random_string (8 ),
5252 ]);
5353 $ id_record = $ dbo ->lastInsertedID ();
Original file line number Diff line number Diff line change 2525switch ($ resource ) {
2626 // Elenco e-mail
2727 case 'get_email ' :
28- $ indirizzi_proposti = $ _GET [ 'indirizzi_proposti ' ] ;
28+ $ indirizzi_proposti = filter ( 'indirizzi_proposti ' ) ;
2929 $ where = '' ;
3030
3131 if ($ indirizzi_proposti == 1 ) {
3232 $ where .= 'AND an_tipianagrafiche_lang.title = "Cliente" ' ;
3333 } elseif ($ indirizzi_proposti == 2 ) {
3434 $ where .= 'AND an_tipianagrafiche_lang.title = "Fornitore" ' ;
35+ } else {
36+ $ indirizzi_proposti = null ;
3537 }
3638
3739 $ results = [];
Original file line number Diff line number Diff line change 4545 $ newsletter ->completed_at = filter ('completed_at ' );
4646
4747 $ newsletter ->subject = filter ('subject ' );
48- $ newsletter ->content = $ _POST [ ' content ' ]; // post('content', true );
48+ $ newsletter ->content = post ('content ' );
4949
5050 $ newsletter ->save ();
5151
You can’t perform that action at this time.
0 commit comments