CVE-2024-32978

6.6 MEDIUM

📋 TL;DR

Kaminari pagination library for Ruby on Rails has insecure file permissions that could allow unauthorized write access to specific Ruby files. This could lead to altered application behavior or data integrity issues. Users of affected Kaminari versions are vulnerable.

💻 Affected Systems

Products:
  • Kaminari pagination library for Ruby on Rails
Versions: Versions before 0.16.2
Operating Systems: All operating systems running Ruby
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all installations using vulnerable Kaminari versions regardless of configuration.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could modify Ruby files to execute arbitrary code, potentially leading to complete system compromise or data manipulation.

🟠

Likely Case

Unauthorized modification of pagination behavior or injection of malicious code into application files.

🟢

If Mitigated

Minimal impact with proper file permissions and access controls in place.

🌐 Internet-Facing: MEDIUM - Web applications using Kaminari could be targeted if attackers gain file system access.
🏢 Internal Only: LOW - Requires existing access to the file system where Kaminari is installed.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires file system access to modify Kaminari files.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.16.2

Vendor Advisory: https://github.com/kaminari/kaminari/security/advisories/GHSA-7r3j-qmr4-jfpj

Restart Required: Yes

Instructions:

1. Update Gemfile to specify 'gem "kaminari", ">= 0.16.2"' 2. Run 'bundle update kaminari' 3. Restart Rails application server

🔧 Temporary Workarounds

Manual file permission adjustment

linux

Adjust file permissions on Kaminari Ruby files to restrict write access

chmod -R 644 /path/to/kaminari/files/*.rb
chown -R root:root /path/to/kaminari/files/

🧯 If You Can't Patch

  • Review and tighten file permissions on all Kaminari Ruby files to ensure only authorized users have write access
  • Implement file integrity monitoring on Kaminari files to detect unauthorized modifications

🔍 How to Verify

Check if Vulnerable:

Check Gemfile.lock or run 'bundle show kaminari' to see installed version

Check Version:

bundle show kaminari | grep -o 'kaminari.*'

Verify Fix Applied:

Verify version is 0.16.2 or higher with 'bundle show kaminari'

📡 Detection & Monitoring

Log Indicators:

  • File modification events on Kaminari Ruby files
  • Unexpected application behavior changes

Network Indicators:

  • None - this is a local file system vulnerability

SIEM Query:

File modification events where target_path contains 'kaminari' and extension is '.rb'

🔗 References

📤 Share & Export