Skip to content
Info disclosure Disclosed report Intermediate CVE-2022-32218

Message ID Enumeration with Action Link Handler

gronke Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • Triaged in 2 months
  • Fixed in 7 months
  • Disclosed after 10 months

Summary by the program

Summary

The actionLinkHandler method was found to allow Message ID Enumeration with Regex MongoDB queries.

Releases Affected:

The Meteor method actionLinkHandler calls an actionLinks wrapper getMessage to find affected messages:

JavaScript
Meteor.methods({
	actionLinkHandler(name, messageId) {
		if (!Meteor.userId()) {
			throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'actionLinkHandler' });
		}

		const message = actionLinks.getMessage(name, messageId);
		const actionLink = message.actionLinks[name];

		actionLinks.actions[actionLink.method_id](message, actionLink.params);
	},
});

The actionLinks.getMessage method does not validate the input data, so that a { $regex: ".*" } pattern can be used to enumerate for the existence of Messages with MongoDB Injection.

JavaScript
getMessage(name, messageId) {
	const userId = Meteor.userId();
	if (!userId) {
		throw new Meteor.Error('error-invalid-user', 'Invalid user', { function: 'actionLinks.getMessage' });
	}

	const message = Messages.findOne({ _id: messageId });
	if (!message) {
		throw new Meteor.Error('error-invalid-message', 'Invalid message', { function: 'actionLinks.getMessage' });
	}
	// ...
}

Whenever a Message ID does not match any existing message, the server will respond with invalid-message error. When it does exist, a different response (or error) is returned, so that the guess can be evaluated.

JavaScript
Meteor.call(
  "actionLinkHandler",
  "joinJitsiCall",
  { $regex: ".*" },
  console.log
);

Although only Message IDs (and not their content) can be enumerated, mitigating this issue becomes relevant to prevent adversaries from stacking it with other information disclosure vulnerabilities that would leak a message content for known Message IDs.

Steps To Reproduce (from initial installation to vulnerability):

  1. Login to Rocket.Chat
  2. Query actionLinkHelper to check if a message matches
  3. Extend static part of the regex
  4. Repeat step 2

Suggested mitigation

  • Check messageId for String type

Impact

Authenticated adversaries can enumerate the server for existing Message IDs.

Fix

Fixed in 4.7.5, 4.8.2 and 5.0>

The original report as published on HackerOne, by gronke. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A medium-severity info disclosure bug in Rocket.Chat, rated CVSS 4.3. HackerOne made it public on 22 September 2022 as CVE-2022-32218.

About Info disclosure

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by gronke

View all

27 more disclosed reports, best first.

More from Rocket.Chat

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.