Skip to content

Commit 55fe602

Browse files
authored
Fix emoji xss (#2601)
* Remove risky output text handling in emoji replacer Removed $sce trust from output text in emoji replacer. * Fix typo in output preview heading * Include emoji output image in README Add emoji output image to README
1 parent 63d7609 commit 55fe602

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Modern Development/Service Portal Widgets/Emoji Replacer Widget/Client Script.cs renamed to Modern Development/Service Portal Widgets/Emoji Replacer Widget/Client Script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
api.controller=function($scope,$sce) {
1+
api.controller=function($scope) {
22
/* widget controller */
33
var c = this;
44

@@ -20,6 +20,6 @@
2020
var regex = new RegExp(key.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1"),'g');
2121
text = text.replace(regex,c.emojiMap[key]);
2222
}
23-
c.outputText= $sce.trustAsHtml(text);
23+
c.outputText= text;
2424
}
2525
};

Modern Development/Service Portal Widgets/Emoji Replacer Widget/HTML.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h4>😊
99
placeholder="Type your message here..."></textarea>
1010
<div class ="mt-3">
1111
<h5>
12-
Ouput Preview:
12+
Output Preview:
1313
</h5>
1414
<div class="p-2 border rounded bg-light" ng-bind-html="c.outputText">
1515

Modern Development/Service Portal Widgets/Emoji Replacer Widget/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ This widget enhances the user experience by automatically converting emojis code
1919
":tada:":🎉
2020
## Output
2121

22-
22+
![Emoji Output](emoji.png)

0 commit comments

Comments
 (0)