[Koha-bugs] [Bug 24788] New: Koha::Object->store calls column names as methods, relying on AUTOLOAD, with possibly surprising results

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 3 14:28:53 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24788

            Bug ID: 24788
           Summary: Koha::Object->store calls column names as methods,
                    relying on AUTOLOAD, with possibly surprising results
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: glasklas at gmail.com
        QA Contact: testopia at bugs.koha-community.org

Koha::Object->store accesse sDBIx::Class::Row columns as $self->$col, using
AUTOLOAD, which in effect makes column names and methods share the same
namespace. I'm no security expert, but I think this should be considered bad
practice and could be an attack vector. It also has huge potential for causing
strange bugs, which happened in Bug 14957 where a column is named "delete",
calling the "delete" method instead of fetching the column value as intended.
Here is patch to fix this using a separate namespace for setting/getting
columns through get_column/set_column instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list