CVE-2016-1000231: Cross-Site Scripting in emojione

emojione Updated 02 Oct 2025

Summary

01/09/2020
Yes i
High
Not published

CVE-2016-1000231: Cross-Site Scripting in emojione. Affects emojione versions < 1.3.1. Fixed in 1.3.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The emojione package is an npm package that provides a library for converting emoji shortcodes and Unicode to images. It is commonly used in web applications to display emojis. However, versions of emojione up to 1.3.0 are vulnerable to a cross-site scripting (XSS) attack when user input is passed into certain functions. This vulnerability can allow an attacker to inject malicious code into the application, potentially leading to unauthorized access, data theft, or other malicious activities.

Vulnerability Detail

The vulnerability in emojione arises from a lack of proper input sanitization and validation in the toShort(), shortnameToImage(), unicodeToImage(), and toImage() functions. When user input is not properly sanitized, an attacker can craft malicious input that includes JavaScript code. This code will then be executed in the context of the application, allowing the attacker to perform actions on behalf of the user or manipulate the application's behavior. This vulnerability has a high severity rating and is classified as CWE-79, which is the Common Weakness Enumeration for Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

How To Fix

Minimum fixed version

1.3.1

This is the first release that contains the fix.

npm install emojione@1.3.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the package is not immediately feasible, a temporary workaround is to manually sanitize and validate user input before passing it to the vulnerable functions. This can be done using a library or framework that provides input sanitization and validation functions. Here is an example using the xss library:

const xss = require('xss');

const userInput = getUserInput();
const sanitizedInput = xss(userInput);

// Pass the sanitized input to the vulnerable functions
const result = emojione.toShort(sanitizedInput);

Note that this workaround is not a permanent solution and should be replaced with the recommended update as soon as possible.

Conclusion

The emojione package up to version 1.3.0 is vulnerable to a cross-site scripting (XSS) attack. It is recommended to update to version 1.3.1 or later to fix this vulnerability. If updating is not immediately feasible, manual input sanitization and validation can be used as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for emojione →

Share this vulnerability

FAQ

This vulnerability allows an attacker to inject malicious code into the application, potentially leading to unauthorized access, data theft, or other malicious activities.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your package-lock.json file, and Vulert will analyze it for any known vulnerabilities, including this one.

Yes, updating to version 1.3.1 or later of the emojione package will fix this vulnerability.

A temporary workaround is to manually sanitize and validate user input before passing it to the vulnerable functions. However, this should be replaced with the recommended update as soon as possible.

How To Fix

Minimum fixed version

1.3.1

This is the first release that contains the fix.

npm install emojione@1.3.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback