1. Home
  2. Web App Vulnerabilities
  3. How to remediate – InMail/InShop inmail.pl / inshop.pl XSS

How to remediate – InMail/InShop inmail.pl / inshop.pl XSS

1. Introduction

The InMail/InShop application is vulnerable to a cross-site scripting (XSS) attack in the ‘inmail.pl’ and ‘inshop.pl’ scripts. This allows attackers to inject malicious code into web pages viewed by other users, potentially stealing cookie-based authentication credentials. Affected systems are typically web servers hosting the InMail/InShop Perl application. A successful exploit could compromise confidentiality, integrity, and availability of user accounts and data.

2. Technical Explanation

The vulnerability stems from inadequate validation of user input in the ‘acao’ argument of ‘inmail.pl’ and the ‘screen’ argument of ‘inshop.pl’. This allows an attacker to inject arbitrary JavaScript code that executes within a victim’s browser. Exploitation requires tricking a user into visiting a malicious URL containing the crafted payload. The vulnerability is tracked as CVE-2004-1196 and CVE-2004-1197, with CWE IDs 20, 442, 629, 711, 712, 722, 725, 74, 750, 751, 79, 800, 801, 809, 811, 864, 900, 928, 931 and 990. As an example, an attacker could craft a URL with malicious JavaScript in the ‘acao’ parameter of ‘inmail.pl’ to steal cookies.

  • Root cause: Missing or insufficient input validation on the ‘acao’ argument within ‘inmail.pl’ and the ‘screen’ argument within ‘inshop.pl’.
  • Exploit mechanism: An attacker crafts a malicious URL containing JavaScript code in the vulnerable parameter, then tricks a user into visiting it. The injected script executes in the victim’s browser.
  • Scope: InMail/InShop web applications written in Perl are affected. Specific versions were not provided in the available context.

3. Detection and Assessment

Confirming vulnerability requires checking for the presence of the application and then testing input validation.

  • Quick checks: Check if the InMail/InShop application is installed on the web server by looking for ‘inmail.pl’ or ‘inshop.pl’ in the web root directory.
  • Scanning: Nessus plugin ID 10935 can detect this vulnerability, but results should be verified manually.
  • Logs and evidence: Examine web server logs for requests containing suspicious characters or JavaScript code in the ‘acao’ parameter of ‘inmail.pl’ or the ‘screen’ parameter of ‘inshop.pl’.
# Example command placeholder:
# ls /path/to/webroot/ -l | grep inmail.pl

4. Solution / Remediation Steps

There is no known solution at this time, so mitigation focuses on limiting exposure and monitoring for attacks.

4.1 Preparation

  • No services need to be stopped for these steps.
  • Roll back plan: Restore from backup or revert the snapshot.

4.2 Implementation

  1. Step 1: Implement strict input validation on all user-supplied data, especially in ‘inmail.pl’ and ‘inshop.pl’. This is a development task.
  2. Step 2: Encode output to prevent JavaScript execution. This is also a development task.
  3. Step 3: Consider using a web application firewall (WAF) to filter malicious requests.

4.3 Config or Code Example

Before

# Insecure example - no input validation
$acao = $q->param('acao');
print "You selected: $acao";

After

# Secure example - with input validation and encoding
use HTML::Entities;
my $acao = $q->param('acao');
$acao = encode_entities($acao); # Encode output to prevent XSS
print "You selected: $acao";

4.4 Security Practices Relevant to This Vulnerability

Several security practices can help mitigate this type of issue.

  • Practice 2: Output encoding prevents malicious code from being executed by the browser. Encode all output that contains user-supplied data.

4.5 Automation (Optional)

No automation is available at this time due to lack of a patch or configuration change.

5. Verification / Validation

Confirm the fix by attempting to inject malicious code and verifying it does not execute.

  • Post-fix check: Verify that input validation prevents JavaScript code from being injected into the ‘acao’ parameter of ‘inmail.pl’.
  • Re-test: Attempt the exploit described in section 2 again to confirm it no longer works.
  • Monitoring: Monitor web server logs for any attempts to inject malicious code into the ‘acao’ parameter of ‘inmail.pl’.
# Post-fix command and expected output
# Attempting to inject <script>alert('XSS')</script> in the acao parameter should not display an alert box.

6. Preventive Measures and Monitoring

Proactive measures can help prevent similar vulnerabilities.

  • Baselines: Update security baselines to include input validation and output encoding requirements for web applications.
  • Pipelines: Integrate static application security testing (SAST) tools into the CI/CD pipeline to identify potential XSS vulnerabilities early in the development process.
  • Asset and patch process: Implement a regular patch management cycle to ensure all software is up-to-date with the latest security fixes.

7. Risks, Side Effects, and Roll Back

Implementing input validation may introduce compatibility issues or require code changes.

  • Risk or side effect 1: Input validation could break existing functionality if not implemented carefully. Thorough testing is required.
  • Risk or side effect 2: Output encoding might affect the appearance of certain characters in web pages.

8. References and Resources

Links to relevant resources for this vulnerability.

  • Vendor advisory or bulletin: No vendor advisory was provided in the available context.
  • NVD or CVE entry: CVE-2004-1196, CVE-2004-1197
  • Product or platform documentation relevant to the fix: No specific documentation was provided in the available context.
Updated on December 27, 2025

Was this article helpful?

Related Articles