Closed alis-khadka closed 2 years ago
ExternalApiClient has a column called model_definition
implement this as a before_save validation where we would gsub
/ replace all the restricted strings with something (which breaks the malicious code)
https://github.com/restarone/violet_rails/blob/master/app/models/api_action.rb#L64-L67
We are using 'eval(#custom code)' in our code. We need to implement a way to scrub method/model definitions coming into Violet Rails of things like: Subdomain, Apartment, Tenant, switch, Subdomain.destroy_all, Subdomain.update_all, global_admin, can_manage_users, -- so we can open this upto platform developers on subdomains instead of whole systems (like how we have it now, because of this vulnerability).