STIGhubSTIGhub
STIGsSearchCompareAbout

STIGhub

A free tool to search and browse the entire DISA STIG library. Saves up to 75% in security compliance research time.

Navigation

  • Browse STIGs
  • Search
  • Compare Versions

Resources

  • About
  • VPAT
  • DISA STIG Library
Powered by Pylon
© 2026 Beacon Cloud Solutions, Inc. All rights reserved.
← Back to Apache Tomcat Application Server 9 Security Technical Implementation Guide

V-223005

CAT II (Medium)

ENFORCE_ENCODING_IN_GET_WRITER must be set to true.

Rule ID

SV-223005r1135509_rule

STIG

Apache Tomcat Application Server 9 Security Technical Implementation Guide

Version

V3R4

CCIs

CCI-000366

Discussion

Some clients try to guess the character encoding of text media when the mandated default of ISO-8859-1 should be used. Some browsers will interpret as UTF-7 when the characters are safe for ISO-8859-1. This can create the potential for a XSS attack. To defend against this, enforce_encoding_in_get_writer must be set to true.

Check Content

From the Tomcat server as a privileged user, run the following command:

sudo grep -i  enforce_encoding /etc/systemd/system/tomcat.service 

If there are no results, or if the org.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER is not ="true", this is a finding.

Fix Text

From the Tomcat server as a privileged user: 

Edit the /etc/systemd/system/tomcat.service file, and either add or edit the org.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER setting.

Set the org.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER=true 

EXAMPLE:
Environment='CATALINA_OPTS -Dorg.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER=true'

Restart the Tomcat server:
sudo systemctl restart tomcat
sudo systemctl daemon-reload