Skip to content

Commit ff1b282

Browse files
committed
fix(spp_api_v2): remove url fallback from display_name to prevent security leak
The _compute_display_name method was falling back to record.url when endpoint was not set. Since url has groups="spp_api_v2.group_api_v2_auditor" but display_name is store=True with no groups restriction, the URL value was being persisted into an unrestricted field, bypassing field-level security. Also adds url to @api.depends implicitly by removing the reference entirely. Replace the url fallback with a generic "API Call" string.
1 parent 8d35a40 commit ff1b282

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spp_api_v2/models/api_outgoing_log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class ApiOutgoingLog(models.Model):
142142
def _compute_display_name(self):
143143
for record in self:
144144
timestamp_str = record.timestamp.strftime("%Y-%m-%d %H:%M") if record.timestamp else ""
145-
record.display_name = f"{record.http_method} {record.endpoint or record.url} @ {timestamp_str}"
145+
record.display_name = f"{record.http_method} {record.endpoint or 'API Call'} @ {timestamp_str}"
146146

147147
# ==========================================
148148
# API Methods

0 commit comments

Comments
 (0)