Projet

Général

Profil

Development #42825

valider le paramètre order_by reçu en querystring

Ajouté par Frédéric Péters il y a presque 4 ans. Mis à jour il y a presque 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
13 mai 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Exception:
  type = '<class 'psycopg2.ProgrammingError'>', value = 'missing FROM-clause entry for table "blah" 
LINE 1: ...entifiants_benefic WHERE anonymised IS NULL ORDER BY blah.me
                                                                ^
'

Stack trace (most recent call first):
  File "/usr/lib/python3/dist-packages/wcs/sql.py", line 1339, in get_sorted_ids
  1337         else:
  1338             sql_statement += ' ORDER BY %s' % order_by.replace('-', '_')
> 1339         cur.execute(sql_statement, parameters)
  1340         ids = [x[0] for x in cur.fetchall()]
  1341         conn.commit()
...
REQUEST_URI
'/backoffice/management/demande-d-identifiants-beneficiaire/?1=on&...&order_by=blah.me

Fichiers

Révisions associées

Révision c34a4055 (diff)
Ajouté par Frédéric Péters il y a presque 4 ans

misc: check order_by parameter is a correct identifier (#42825)

Historique

#1

Mis à jour par Frédéric Péters il y a presque 4 ans

ou

Exception:
  type = '<class 'psycopg2.ProgrammingError'>', value = 'unterminated quoted string at or near "'"" 
LINE 1: ..._d_identifiants_benefic WHERE anonymised IS NULL ORDER BY '" 
                                                                     ^

etc.

#2

Mis à jour par Frédéric Péters il y a presque 4 ans

#3

Mis à jour par Thomas Noël il y a presque 4 ans

  • Statut changé de Solution proposée à Solution validée
#4

Mis à jour par Frédéric Péters il y a presque 4 ans

commit c34a405504ea8a7d4902e0bb2118b5a3f81f9835
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Wed May 13 12:51:07 2020 +0200

    misc: check order_by parameter is a correct identifier (#42825)
#5

Mis à jour par Frédéric Péters il y a presque 4 ans

  • Statut changé de Solution validée à Solution déployée

Formats disponibles : Atom PDF