Commit Graph
7646 Commits
Author SHA1 Message Date
Alexandre Alapetite cd2b92509a Changelog 2026-11-25 17:17:45 +01:00
f94c101621 Harden SSRF guard: reject remaining reserved/special-use IP ranges (#9621)
* Reject remaining special-use ranges in the SSRF guard

FILTER_FLAG_GLOBAL_RANGE still accepts several reserved ranges on
supported PHP versions. Reject those explicitly, including when an
IPv4 address is embedded in the public NAT64 prefix, and keep
legitimate public NAT64 addresses allowed.

Co-authored-by: aplaton216 <aplaton216@users.noreply.github.com>

* Refactor

Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-2983-h3r5-qv6j
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-8f2g-vq96-ffxw

* Doc PHP upstream

https://github.com/php/php-src/pull/25426

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: aplaton216 <aplaton216@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-25 15:20:34 +01:00
InverleandAlexandre Alapetite e18c511b11 Minz: Launch actions case-sensitively (#9620)
Fix [GHSA-gqgh-h7rm-f87f](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-gqgh-h7rm-f87f)

Problem can be observed by going to https://demo.freshrss.org/i/?a=abouT. It might not be obvious immediately that the action actually launched. But that's because the view being searched for is `index/abouT.phtml`, which won't work when filenames are case sensitive (view shows up empty instead, but the action launches).

Now with the fixes, the following error message will be shown instead:

>  Invalid action name “abouTAction” for controller “FreshRSS_index_Controller”.

This is relevant for e.g. [xExtension-Captcha](https://github.com/FreshRSS/Extensions/tree/main/xExtension-Captcha).

* Minz: Launch actions case-sensitively

* Simplify and more robust

* Stricter classAutoloader

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-25 08:31:58 +01:00
Alexandre Alapetite 5d81cd8832 Avoid duplicated enclosure titles (#9615)
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-pwpq-78jm-px4m
2026-11-24 09:14:10 +01:00
Alexandre Alapetite a3d8ce7aab SimplePie: Fix regex in clean_hash() (#9616)
fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-8pj8-6xgr-8r8f
And there was also a bug for PHP < 8.4, which does not recognise the regex quantifier `{,8192}` but only `{0,8192}`
2026-11-24 09:02:35 +01:00
Alexandre Alapetite e1c35839a3 Bump cssxpath (#9618)
Upstream PR is merged:
* https://github.com/phpgt/CssXPath/pull/256

Follow-up of https://github.com/FreshRSS/FreshRSS/pull/9567
2026-11-24 08:11:35 +01:00
Alexandre Alapetite fa16ffdeeb Start next version 2026-11-23 09:37:26 +01:00
Alexandre Alapetite 09f4b078c8 Credits 1.31.0 2026-11-23 09:13:38 +01:00
Alexandre Alapetite 8999ba8e59 Release 1.31.0 2026-11-23 08:47:21 +01:00
Alexandre Alapetite 622d7be2fe Changelog 2026-11-23 08:36:21 +01:00
Inverle 306327a9d5 Lychee CI: only check changed URLs in PRs (#9614)
Ref: https://github.com/FreshRSS/FreshRSS/pull/9209#issuecomment-6534445300

Only checks modified or added URLs in PRs to reduce noise. The workflow still continues to scan the entire repo for push and cron events.

Tested working in a fork PR.
2026-11-23 08:30:13 +01:00
Alexandre Alapetite dcd40cb7d4 Better sanitize domains (#9611)
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-3ch8-46c3-xr9h
2026-11-22 21:57:54 +01:00
Alexandre Alapetite 6320ff8af7 More secure remove access (#9610)
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-r27w-hr3c-hjr3
2026-11-22 21:54:39 +01:00
Chareonwit KunnaandAlexandre Alapetite cf6a0a5c35 docs: fix doubled words (#9609)
* docs: fix doubled word

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>

* docs: fix doubled word

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>

* docs: fix doubled word

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>

* docs: fix doubled word

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>

* One more

---------

Signed-off-by: Chareonwit Kunna <21arenabreakout12@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-22 13:20:56 +01:00
Inverle 6a6b23bf82 Fix HTML injection in extension names (#9608)
Fix [GHSA-crc7-3qcq-m9h3](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-crc7-3qcq-m9h3)
2026-11-22 08:54:32 +01:00
Alexandre Alapetite aa97720c9c Changelog 2026-11-21 23:25:18 +01:00
Alexandre Alapetite 3c13b68dc9 Improve test-all-php-versions for PostgreSQL (#9606)
To avoid skipped tests.
Follow-up of:
* https://github.com/FreshRSS/FreshRSS/pull/9576
* https://github.com/FreshRSS/FreshRSS/pull/9535
2026-11-21 22:40:40 +01:00
Alexandre Alapetite 2855de21e3 Fix full-content logic (#9602)
Rewritten inspired by MIME multipart boundaries.
Fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-5hcv-wqwr-j8r8
2026-11-21 22:39:13 +01:00
Alexandre Alapetite 71cda6bfe2 Fix regression lazyload (#9601)
fix https://github.com/FreshRSS/FreshRSS/pull/7864#issuecomment-7036632538
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/5816
2026-11-20 23:04:26 +01:00
Alexandre Alapetite 67cb0a2d9a Sanitize DB install params (#9595) 2026-11-20 22:41:26 +01:00
Inverle 2f31a2fdf5 Fix HTML injection in view mode error notification (#9605)
Fix [GHSA-wpf6-5v7v-6cvj](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-wpf6-5v7v-6cvj)

Introduced in https://github.com/FreshRSS/FreshRSS/pull/7668
2026-11-20 22:11:25 +01:00
Inverle 67e05b0b77 Fix make start stopping on terminal resize (#9603)
* Fix `make start` stopping on terminal resize

* Update documentation examples for `docker run`

* Clarify Ctrl+C under Development mode section
2026-11-20 17:58:45 +01:00
Alexandre Alapetite 8ffddc11f8 More security for extension files: nosniff (#9593)
Global `X-Content-Type-Options: nosniff`
And follow-up of #7753
2026-11-20 13:54:09 +01:00
Alexandre Alapetite 13280a4dfc Safer login (#9592)
Avoid using some functions changing state before full verification.
Related to https://github.com/FreshRSS/FreshRSS/pull/9598
2026-11-20 10:24:29 +01:00
Inverle 2584514db3 Deny formLogin access if already logged in (#9598)
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/9592

There is no reason for logged in users to have access to the login page.
2026-11-20 08:10:27 +01:00
Alexandre Alapetite 34822e73a2 Changelog 2026-11-19 23:51:41 +01:00
Alexandre Alapetite ae664c8ccd Better sanitize bookmark (#9594) 2026-11-19 23:20:55 +01:00
Alexandre Alapetite ea646d2bde Use PHP 8.4+ \Dom classes and functions (#9567)
Currently, SimplePie uses legacy DOMDocument parsing, which outputs potentially problematic HTML, not correctly sanitised.
This breaks the assumption that one can use something like `<div><!-- some HTML sanitized from SimplePie --></div>`.

```
--- Expected
+++ Actual
@@ @@
 '<ul>
-    <li><div></div></li>
+    <li><div>
     <li>Item</li>
-</ul>'
+</div></li></ul>'
```

When shown in a compliant Web browser, several tags will be wrongly closed, breaking the layout of the client.

This PR patches SimplePie to use the modern parser and code syntax, while maintaining a best-effort polyfill for legacy PHP versions < 8.4.

Depends on:

SimplePie: Upgrade to PHPStan 2
* https://github.com/FreshRSS/simplepie/pull/97
* https://github.com/simplepie/simplepie/pull/939
* https://github.com/simplepie/simplepie/pull/1019

SimplePie: Use PHP 8.4+ \Dom classes and functions
* https://github.com/FreshRSS/simplepie/pull/98
* https://github.com/simplepie/simplepie/issues/1021

SimplePie: Add unit test for HTML5 sanitizing compliance
* https://github.com/simplepie/simplepie/pull/1022

SimplePie: Remove obsolete xml_is_sane and XMLReader fallback
* https://github.com/simplepie/simplepie/pull/1023

CssXPath: Add support for case insensitivity
* https://github.com/phpgt/CssXPath/pull/256

fix https://github.com/FreshRSS/FreshRSS/issues/5201
fix https://github.com/FreshRSS/FreshRSS/issues/6830
fix https://github.com/FreshRSS/FreshRSS/issues/6831

~5% faster for HTML sanitising.
Remove SimpleXML. Remove XMLReader.
2026-11-19 23:17:04 +01:00
Sadetdin EYILIandAlexandre Alapetite 5ad167e6f3 perf(image): replace js images lazy loading by html loading attribute (#5816)
* perf(image): replace js images lazy loading by html `loading` attribute

* Improve lazy images regex
Fix https://github.com/FreshRSS/FreshRSS/issues/2371
Replaces https://github.com/FreshRSS/FreshRSS/pull/5816
Replaces https://github.com/FreshRSS/FreshRSS/pull/9004

* Reduce comments

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-19 22:52:08 +01:00
Alexandre Alapetite 01b95a096d Shared user queries: remove irrelevant parameter (#9589)
Ensure internal parameters do not appear in URL
2026-11-19 21:36:57 +01:00
Alexandre Alapetite 289a00be00 A few misc. security enhancements (#9591) 2026-11-19 20:09:02 +01:00
Alexandre Alapetite 6aeca31312 Add Cross-Origin-Opener-Policy (COOP) header (#9588)
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Opener-Policy
2026-11-19 20:08:21 +01:00
da8138c414 Update Markdown docs to replace log overwriting with appending (#9581)
* Update Markdown docs to replace log overwriting with appending

Closes https://github.com/FreshRSS/FreshRSS/issues/9577

* Wording tweak for cron job log appending

https://github.com/FreshRSS/FreshRSS/pull/9581#discussion_r4612359046

Co-Authored-By: @Frenzie

* Search & Replace

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-19 17:36:13 +01:00
IEEE-754 3c36d36b48 i18n: Improve Traditional Chinese translations (#9590)
- Refine wording
- Add some new translations
2026-11-19 16:21:43 +01:00
Alexandre Alapetite b3df88f0e2 Changelog 2026-11-18 22:59:50 +01:00
Alexandre Alapetite cd08cd808e Lychee: HTTPS dl-cdn.alpinelinux.org (#9584)
https://wiki.alpinelinux.org/wiki/Repositories
2026-11-18 16:05:26 +01:00
Ricardo SimõesandAlexandre Alapetite c4a4924529 Update conf.php - European Portuguese pt-PT translation (#9583)
* Update conf.php - European Portuguese pt-PT translation

Translated just 1 string at line 314

* make fix-all

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-18 15:23:56 +01:00
RaedandRaed 1a5a2aefa6 Return false when the configuration file cannot be replaced (#9580)
Minz_Configuration::save() discarded the result of the rename() that
installs the new configuration file, so a failed replacement was
reported as a successful save and left the temporary file behind.

Co-authored-by: Raed <Raed2180416@users.noreply.github.com>
2026-11-18 13:39:03 +01:00
RaedandRaed 60e477423f Fix TypeError from entry IDs on 32-bit platforms (#9578)
An integer literal above PHP_INT_MAX is a float on x86, and _id() only
accepted int|string, so the export test failed there with "must be of type
string|int, float given".

* Build entry IDs as strings in the tests

1700000000000000 + $i is a float on 32-bit platforms, where it exceeds
PHP_INT_MAX, and FreshRSS_Entry::_id() rejects it. Entry IDs are strings
everywhere else, since uTimeString() and the DAO layer both produce
numeric strings, so keep the ID a string in the test instead of accepting
a float. A test now pins that contract.

Refs #9569

---------

Co-authored-by: Raed <Raed2180416@users.noreply.github.com>
2026-11-18 12:52:00 +01:00
Alexandre Alapetite 735c3690b1 make test-all-php-versions (#9576)
Convinience command to test all supported versions of PHP at once
Used for https://github.com/FreshRSS/FreshRSS/pull/9567
2026-11-17 13:46:17 +01:00
d6c907bc04 SQLite, PostgreSQL: batch markRead for lists of IDs (#9575)
Closes #9574

Changes proposed in this pull request:

- `FreshRSS_EntryDAOSQLite::markRead()` now passes arrays of IDs to `FreshRSS_EntryDAO::markRead()`. That method already does a batched `UPDATE … WHERE is_read<>? AND id IN (…)`, split into chunks by `MAX_VARIABLE_NUMBER` (998, which also covers SQLite's parameter limit), then refreshes the unread caches once. For lists of fewer than 6 IDs it still calls back into the existing per-entry SQLite/PostgreSQL path. `FreshRSS_EntryDAOPGSQL` inherits the change.
- The `@param` type now matches the parent's `list<numeric-string>` (PHPStan `argument.type`).

How to test the feature manually:

1. Use PostgreSQL with some latency (`tc qdisc add dev eth0 root netem delay 25ms` on the database host gave about 75 ms per round trip).
2. Mark several hundred unread articles read in a single Google Reader API `edit-tag` request, or call `FreshRSS_Factory::createEntryDao()->markRead($ids, true)` from a CLI script.
3. Compare elapsed time and check that `SUM(cache_nbUnreads)` still equals the unread count in `_entry`.

My results (official `edge` image; the DAO files are identical in 1.30.4):

| Backend | Case | Before | After |
|---|---|---|---|
| PostgreSQL 17, ~75 ms RTT | mark 300 read | 60.5 s | 0.16 s |
| PostgreSQL 17, ~75 ms RTT | resend the same 300 (no change) | 37.6 s | 0.08 s |
| PostgreSQL 17, ~75 ms RTT | mark 2,500 read / unread (chunked) | not run | 0.49 s / 0.49 s |
| SQLite | mark 300 read | 1.48 s | 0.01 s |
| SQLite | mark 2,500 read / unread (chunked) | not run | 0.04 s / 0.04 s |

Unread caches matched the entry table in every case, including lists under 6 IDs and mark-unread. A production instance (PostgreSQL about 100 ms away) has been running the PostgreSQL variant of this change. Reeder on iOS, which had been timing out on every sync, now syncs normally, and `edit-tag` requests finish in under a second.

* SQLite, PostgreSQL: batch markRead for lists of IDs

FreshRSS_EntryDAOSQLite::markRead() handled an array of IDs one entry
per transaction, and FreshRSS_EntryDAOPGSQL inherits it. Delegate
arrays to FreshRSS_EntryDAO::markRead(), whose batched
UPDATE ... WHERE is_read<>? AND id IN (...) is portable, is chunked by
MAX_VARIABLE_NUMBER, and calls back into the per-entry path for small
lists.

Fix https://github.com/FreshRSS/FreshRSS/issues/9574

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Reduce comments

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-17 09:28:55 +01:00
Ricardo Simões d614912f3c Update pt-PT translation (#9573)
Updates European Portuguese pt-PT translation
2026-11-17 08:15:12 +01:00
Corey QuinnandAlexandre Alapetite e7fe44bf86 PostgreSQL: detect FreshRSS tables by visibility rather than owner (#9535)
* PostgreSQL: the owner was never the story, so stop asking who owns the tables

For as long as the install check has existed, it asked pg_tables who owned
the tables and compared that against the database login. Nobody asked why.
The login is a gateway user, the tables belong to whatever role ran the
install, and whenever those two names diverged the check reported the schema
as missing. Visibility was the question all along.

tablesAreCorrect() now asks pg_class which ordinary and partitioned tables
are visible on the search_path. If PostgreSQL can see it, it counts. A table
parked in a schema outside the path does not hide a missing one, and a view
named like a table is not a table.

The new test builds a role, a visible schema, a hidden schema, and a view
with a suspicious name, then checks that each answer is the true one. It runs
against a real PostgreSQL 18 service in CI. Locally it skips unless
FRESHRSS_TEST_PGSQL_DSN is set.

* Pin the CI Postgres service to a digest, because somebody moved the tag

For the record: nobody announced it. The postgres:18-alpine tag sat in
tests.yml like a loaded gun pointed at every CI run, and zizmor was the
first thing to notice it had no fixed identity at all. Remember the
Denver Airport. Remember that tags are not promises.

This commit replaces the mutable tag with the exact multi-arch digest the
suite was already tested against:

  postgres:18-alpine@sha256:eaef288f54a90a909e49f0121d5d047a5e974e922699de4249625cf7cde34f36

This is not a version bump. Same image, same PostgreSQL 18, same Alpine
base. The only thing that changed is that the image can no longer be
swapped out from under us between Tuesday's green run and Thursday's
mystery failure.

Verification: all pre-commit PHP, test, JS, CSS and Markdown checks pass.
Local pedantic offline zizmor reports no findings. This resolves the
unpinned-service-image blocker on PR #9535.

* Rewrite test a bit

* Fix make test-all

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-16 23:26:18 +01:00
Inverle 77e74e81b7 Serve consistent error responses on failed logins (#9568)
Fixes #4095

Follow-up of #9566

Although no separate error message for disabled users yet (will be done in another PR).
2026-11-16 22:38:25 +01:00
Inverle 06c0329de2 Fix wrong status code on failed login (#9566)
Regression from https://github.com/FreshRSS/FreshRSS/pull/9358 (PR not present in current release, stopped sending 403 on failed logins).

This PR fixes the Minz bug mentioned in https://github.com/FreshRSS/FreshRSS/pull/9358#discussion_r4382254359 which occurred with `redirect: false` redirects.

But it also takes a different approach for redirecting, by using HTML instead of the `Location` header (to address one additional issue with a resubmit prompt appearing when refreshing the login page after a failed login).

403 is now returned during failed reauthentication as well.
2026-11-15 23:34:53 +01:00
Artem Netsvetaev 62c47b7168 Fix lookup of the localised default category (#9543)
The GReader API exposes a translated default category name while the database stores Uncategorized. Resolve that name by the constant category ID so marking the category as read accepts the label returned by the API.

Add SQLite regression coverage for English, Russian and French, ordinary Cyrillic category names with spaces, and missing categories.

Fixes #9542
2026-11-14 22:31:20 +01:00
d1fe6e694d Add option to open articles on their original website (#9554)
* Add option to open articles on their original website

Clicking an article title can now open the original website instead of the article in FreshRSS. The link icon then opens the article in FreshRSS.

fix https://github.com/FreshRSS/FreshRSS/issues/1954

* i18n: fr

---------

Co-authored-by: Eduardo Coronell <eduardo.coronell@aspsols.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-11-14 22:30:32 +01:00
Alexandre Alapetite e66fa341a0 Better catch and log user regex errors (#9559)
To get a chance to find out where they come from:

New log:
```
[Thu, 12 Nov 2026 15:28:27 +0000] [warning] --- FreshRSS_Entry::regexMatch Invalid PCRE regex `/\q/`; preg_match(): Compilation failed: unrecognized character follows \ at offset 1; in search: `intitle:/\q/ author:Alice`; first triggered by entry 1731000000123456 of feed 123
```

instead of:
```
PHP Warning:  preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in /var/www/FreshRSS/app/Models/Entry.php on line 875
```
2026-11-14 21:46:31 +01:00
Alexandre Alapetite e5ae053c03 Bump SimplePie (#9562)
In particular:
* File,Psr18Client: Remove support for local files https://github.com/simplepie/simplepie/pull/994
* Parser: ignore whitespace before the XML declaration https://github.com/simplepie/simplepie/pull/1005
* Require PHP 7.4 or newer https://github.com/simplepie/simplepie/pull/1006, https://github.com/simplepie/simplepie/pull/992
* Parser: treat https Atom 1.0 namespace as Atom https://github.com/simplepie/simplepie/pull/1010
2026-11-14 21:45:58 +01:00
Harries Chen 76e47bc270 README: replace the Zeabur button with Zenavo (#9563)
* README: replace the Zeabur button with Zenavo

Zeabur is shutting down (new deployments stop on 2026-12-01, everything
is off by 2026-12-31), so its template link will stop working. Put a
Zenavo button in the same cell of the Automated install table, in the
English and French READMEs.

* Link the Zenavo button to the template's page

The page can be read without signing in, and has a Deploy now button.
2026-11-14 11:31:26 +01:00