Skip to content

Commit

Permalink
Merge pull request from GHSA-r3jc-3qmm-w3pw
Browse files Browse the repository at this point in the history
Add missing security declarations on the database adapter class
  • Loading branch information
dataflake committed Feb 7, 2024
2 parents 39e2e98 + 7165b1a commit e682b99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,9 @@ Change log
2.2 (unreleased)
----------------

- Add missing security declarations on the database adapter class
to mitigate arbitrary SQL query execution vulnerability.

- Add support for Python 3.12.


Expand Down
3 changes: 3 additions & 0 deletions src/Products/SQLAlchemyDA/da.py
Expand Up @@ -13,6 +13,7 @@

from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import change_database_connections
from AccessControl.Permissions import view_management_screens
from OFS.PropertyManager import PropertyManager
from OFS.SimpleItem import SimpleItem
Expand Down Expand Up @@ -295,6 +296,7 @@ def engine_options(self):
engine_options = dict(self.extra_engine_options)
return engine_options

@security.protected(change_database_connections)
def add_extra_engine_options(self, engine_options):
""" engine_options is a tuple containing additional
options for sqlalchemy.create_engine.
Expand Down Expand Up @@ -346,6 +348,7 @@ def _typesMap(self, proxy):
self._v_types_map = map
return self._v_types_map

@security.private
def query(self, query_string, max_rows=None, query_data=None):
""" *The* query() method as used by the internal ZSQL
machinery.
Expand Down

0 comments on commit e682b99

Please sign in to comment.