legacy-knowledge-base
公開されました Jun. 30, 2025

Not able to paste image directly into the CKEditor (Web content)

投稿者

Madhusudan Sharma

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • Not able to directly paste the image in CKEditor (Webcontent).

Steps to Reproduce:

1. Start Liferay Quarterly Release 2023.q4.4.
2. Navigate to Product Menu > Web Content > Click 'New Button' and then 'Basic Web Content'.
3. Give it a name, let's say 'Test'.
4. Now, add some content and copy-paste an image directly into the CKEditor (using ctrl+v).
5. Publish the web content.
6. Open the saved web content, the image is not there and the below warning can be observed in the logs:

WARN [http-nio-8080-exec-1][AntiSamySanitizerImpl:131] The img tag contained an attribute that we could not process. The src attribute had a value of "data:image/jpeg&#59;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxISEBUSEBIVFRUXEBUVFhUVFQ8VFRcXFRYWFxUWFhUYHSggGBolGxcVITEhJSkrLi4uFyAzODMtNygtLisBCgoKDg0OGhAQGy0lICUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAMoA+QMBEQACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAAAgMEBQYBBwj/xABGEAACAgEBBQQF ............ This value could not be accepted for security reasons. We have chosen to remove the entire img tag in order to continue processing the input. 

Expected Behavior: The image should be added to the web content when directly pasting (using ctrl+v).
Observed Behavior: The image is not getting added to the web content when directly pasting (using ctrl+v).

Environment

  • Liferay DXP 7.4

Resolution

  • The observed behavior is a known issue/bug.
  • If a hotfix is required for this issue, please create a support ticket requesting a hotfix by attaching patch details.
  • Installing Fix Packs and Hotfixes on Liferay DXP will guide to installation of the hotfix in the respective environment.
did-this-article-resolve-your-issue

legacy-knowledge-base