Skip to content

Conversation

Xhoenix
Copy link
Member

@Xhoenix Xhoenix commented Jul 15, 2025

Since LaTeX injection payloads start with a backslash, a forward slash could cause False Positives.

@Xhoenix Xhoenix added the release:ignore Ignore for changelog release label Jul 15, 2025
Copy link
Contributor

github-actions bot commented Jul 15, 2025

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

@Xhoenix Xhoenix requested a review from a team July 15, 2025 01:53
Copy link
Member

@RedXanadu RedXanadu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asking this question in a general sense: does this rule make sense?

How would a WAF detect a LaTeX injection attack? Specifically, in the context of HTTP, how would a CRS rule detect an injection attack inside of a LaTeX document file? We don't inspect file contents by default.

This sounds like it would be suitable as an anti-virus feature.

This is interesting work, I just don't see the application in the context of a WAF inspecting HTTP traffic.

If I'm missing an obvious use case here please do let me know.

@Xhoenix
Copy link
Member Author

Xhoenix commented Jul 15, 2025

@RedXanadu You're right, this rule needs to be modified to include only matches for specific LaTeX commands which can be considered dangerous, as suggested in the original PR where this feature was introduced. Any further suggestions are welcome.

In case you missed the original PR, here is the reference link: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/LaTeX%20Injection

@fzipi
Copy link
Member

fzipi commented Jul 15, 2025

The idea is that the code can be added to a latex file. E.g. there are web latex editors that could be targeted, when saving the file in a remote server.

Xhoenix and others added 4 commits July 17, 2025 11:25
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
@Xhoenix
Copy link
Member Author

Xhoenix commented Jul 17, 2025

Since we are detecting payloads starting with a backslash(\), we can detect this bypass with a slight modification, but looks like the FPs will increase. Any suggestions are welcome.

@RedXanadu
Copy link
Member

RedXanadu commented Jul 17, 2025

@fzipi @Xhoenix Thanks for the context.

If we are targetting specifically web-based LaTeX compilers… that is such a tiny number of users, I don't think we can justify having this on by default for all CRS users at PL 1.

It's similar to the discussion in #4208 over 'Edge Side Inclusion' rules. If it is only relevant to a tiny section of users, do we want this on by default.

On the other hand, if I am one of those rare users who is hosting some interactive web LaTeX then I would want this rule enabled and probably at PL 1 or 2, so the easy solution of "let's just put this rule at a high PL" isn't necessarily a great idea. This seems like a problem that will be easier to solve when 'compiling the rule set' becomes a reality.

I think this at least needs a wider group discussion.

@fzipi
Copy link
Member

fzipi commented Jul 17, 2025

We could make this a plugin 🤔 ?

@RedXanadu
Copy link
Member

RedXanadu commented Jul 17, 2025

A plugin could be a solution. The problem is making sure that someone who would benefit from this new LaTeX rule knows that it exists as a plugin.

The good thing about having it in base CRS is that the rule is already there… But then, back to the problem of 'should this be enabled & executed by default when 99.9% of users won't benefit'. I think probably no? Unless it can go into PL 3 as a more exotic attack target?

I've added this topic to the next agenda, maybe someone else has some better ideas or new arguments to suggest.

@Xhoenix
Copy link
Member Author

Xhoenix commented Jul 17, 2025

I just found out that this rule also covers this bypass to some extent. Since that's a "Complete RCE Ruleset" bypass, we can modify this rule to cover that too?

@theseion
Copy link
Contributor

theseion commented Jul 18, 2025

I just found out that this rule also covers this bypass to some extent. Since that's a "Complete RCE Ruleset" bypass, we can modify this rule to cover that too?

I wouldn't do that. While the syntax is similar, the targets are different and I wouldn't want to mix them.

@Xhoenix Xhoenix requested a review from azurit August 4, 2025 05:46
@Xhoenix Xhoenix changed the title fix(934190): remove forward slash fix(934190): update regex assembly Aug 4, 2025
@theseion
Copy link
Contributor

theseion commented Aug 5, 2025

As discussed in the chat, we will remove the LaTex detection rule. Hence, I'll close this PR.

@theseion theseion closed this Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:ignore Ignore for changelog release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants