diff options
Diffstat (limited to 'rt/lib/RT/ObjectCustomFieldValue_Overlay.pm')
| -rw-r--r-- | rt/lib/RT/ObjectCustomFieldValue_Overlay.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/rt/lib/RT/ObjectCustomFieldValue_Overlay.pm b/rt/lib/RT/ObjectCustomFieldValue_Overlay.pm index 403d216ce..d140d9303 100644 --- a/rt/lib/RT/ObjectCustomFieldValue_Overlay.pm +++ b/rt/lib/RT/ObjectCustomFieldValue_Overlay.pm @@ -175,6 +175,9 @@ content, try "LargeContent" sub Content { my $self = shift; my $content = $self->SUPER::Content; + + return undef unless $self->CustomFieldObj->CurrentUserHasRight('SeeCustomField'); + if ( !(defined $content && length $content) && $self->ContentType && $self->ContentType eq 'text/plain' ) { return $self->LargeContent; } else { @@ -253,11 +256,11 @@ sub _FillInTemplateURL { # special case, whole value should be an URL if ( $url =~ /^__CustomField__/ ) { my $value = $self->Content; - # protect from javascript: URLs - if ( $value =~ /^\s*javascript:/i ) { + # protect from potentially malicious URLs + if ( $value =~ /^\s*(?:javascript|data):/i ) { my $object = $self->Object; $RT::Logger->error( - "Dangerouse value with JavaScript in custom field '". $self->CustomFieldObj->Name ."'" + "Potentially dangerous URL type in custom field '". $self->CustomFieldObj->Name ."'" ." on ". ref($object) ." #". $object->id ); return undef; |
