Skip to content

Commit dd3d768

Browse files
committed
fix: CSV Injection in Application Chat Export
1 parent 675fdd0 commit dd3d768

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apps/application/serializers/application_chat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ def to_row(row: Dict):
193193
def reset_value(value):
194194
if isinstance(value, str):
195195
value = re.sub(ILLEGAL_CHARACTERS_RE, '', value)
196+
if value.startswith(('=', '+', '-', '@')):
197+
value = "'" + value
196198
if isinstance(value, datetime.datetime):
197199
eastern = pytz.timezone(TIME_ZONE)
198200
c = datetime.timezone(eastern._utcoffset)

0 commit comments

Comments
 (0)